/* ==========================================================================
   SOUL MALLS — SISTEMA DE DESIGN & FRONT-END CORPORATIVO (MODELO PADRÃO)
   ==========================================================================
   Vendorizado de SoulMalls/modelofront (commit 2300eb5c, 2026-09-04),
   arquivo modelo-home/css/style.css, sem alteracao de conteudo - copia exata.
   Nao editar aqui para "ajustar ao projeto": mudancas de tokens/componentes
   vem do repo de origem, via novo vendor manual (ver planejamento_interface_web.md,
   secao 3.3). Ajustes especificos desta app, se necessarios, vao em outro arquivo.
   ==========================================================================
   Referência visual unificada para sistemas SaaS da Soul Malls.
   Contém: Tokens de cores, tipografia, header global, sidebar retrátil hover/pin,
   cards de métricas, gráficos, barras de governança, pipeline e tabelas.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ==========================================================================
   DESIGN TOKENS & VARIÁVEIS GLOBAIS
   ========================================================================== */
:root {
  /* Tipografia */
  --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta Corporativa Principal */
  --ink: #102d42;             /* Azul Escuro Institucional / Sidebar */
  --ink-light: #173d59;       /* Variação Média de Azul */
  --ink-dark: #0a1e2d;        /* Azul Profundo */
  --green: #285a7b;           /* Primária Soul Malls (Azul Petróleo) */
  --green-hover: #1d4866;     /* Primária Hover */
  --green2: #eaf1f6;          /* Superfície de Destaque / Gelo */
  --line: #e2e8f0;            /* Linhas e Bordas */
  --muted: #64748b;           /* Texto Secundário */
  --muted-light: #94a3b8;     /* Texto Terciário */
  --cream: #f8fafc;           /* Fundo Secundário */
  --bg-app: #f3f5f7;          /* Fundo Geral da Aplicação */
  --white: #ffffff;

  /* Cores Semânticas / Status */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-success-text: #047857;

  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-warning-text: #b45309;

  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fca5a5;
  --color-danger-text: #b91c1c;

  --color-info: #3b82f6;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --color-info-text: #1d4ed8;

  --color-purple: #7c3aed;
  --color-purple-bg: #faf5ff;
  --color-purple-border: #e9d5ff;
  --color-purple-text: #6d28d9;

  --color-cyan: #06b6d4;
  --color-cyan-bg: #ecfeff;
  --color-cyan-border: #a5f3fc;
  --color-cyan-text: #0e7490;

  --color-orange: #f97316;
  --color-orange-bg: #fff7ed;
  --color-orange-border: #ffedd5;
  --color-orange-text: #c2410c;

  /* Sombras e Elevações */
  --shadow-sm: 0 1px 2px rgba(23, 61, 89, 0.04);
  --shadow-card: 0 1px 3px rgba(23, 61, 89, 0.04), 0 8px 24px rgba(23, 61, 89, 0.06);
  --shadow-hover: 0 4px 14px rgba(23, 61, 89, 0.08), 0 12px 28px rgba(23, 61, 89, 0.05);
  --shadow-dropdown: 0 16px 36px -6px rgba(15, 23, 42, 0.18);
  --shadow-modal: 0 20px 60px rgba(15, 40, 58, 0.25);

  /* Dimensões */
  --header-height: 66px;
  --sidebar-collapsed: 62px;
  --sidebar-expanded: 240px;
  --border-radius-sm: 6px;
  --border-radius: 10px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-pill: 9999px;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

/* ==========================================================================
   ESTRUTURA GLOBAL (SHELL)
   ========================================================================== */
.saas-platform-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
}

.saas-body-wrapper {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

.saas-main-viewport {
  flex: 1;
  min-width: 0;
  padding: 24px 32px 48px;
}

/* ==========================================================================
   HEADER GLOBAL (TOP BAR)
   ========================================================================== */
.app-global-header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  z-index: 1050;
  position: sticky;
  top: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

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

.header-logo-soul {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.header-title-box strong {
  display: block;
  font-weight: 800;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
  font-family: var(--font-title);
  letter-spacing: -0.5px;
}

.header-subtitle {
  color: var(--muted);
  font-size: 0.70rem;
}

.micro-text {
  font-size: 0.70rem;
}

/* Seletor de Shopping Pill */
.shopping-selector-btn {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  text-align: left;
}

.shopping-selector-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.shopping-active-logo {
  height: 22px;
  max-width: 80px;
  object-fit: contain;
}

.shopping-active-name {
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--ink);
}

.shopping-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: var(--white);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  z-index: 1100;
  overflow: hidden;
  box-shadow: var(--shadow-dropdown);
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}

.shopping-dropdown-menu.active {
  display: block;
}

.dropdown-item-custom {
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  width: 100%;
}

.dropdown-item-custom:hover {
  background: #f8fafc;
}

.dropdown-item-custom.active-item {
  background: #eff6ff;
}

.dropdown-item-logo {
  height: 16px;
  width: 24px;
  object-fit: contain;
  opacity: 0.9;
}

/* Notificações & Avatar */
.notification-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.btn-icon-header {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  position: relative;
  transition: all 0.2s ease;
  color: var(--muted);
}

.btn-icon-header:hover {
  background: #f1f5f9;
  color: var(--ink);
  transform: scale(1.05);
}

.user-avatar-btn {
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.user-avatar-btn:hover {
  transform: scale(1.08);
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  border: 2px solid var(--white);
  box-shadow: 0 2px 8px rgba(40, 90, 123, 0.35);
  display: grid;
  place-items: center;
}

.perfil-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: var(--white);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  z-index: 1100;
  overflow: hidden;
  box-shadow: var(--shadow-dropdown);
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}

.perfil-dropdown-menu.active {
  display: block;
}

/* ==========================================================================
   DROPDOWN DE NOTIFICAÇÕES & PENDÊNCIAS
   ========================================================================== */
.notifications-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  background: var(--white);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  z-index: 1100;
  overflow: hidden;
  box-shadow: var(--shadow-dropdown);
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}

.notifications-dropdown-menu.active {
  display: block;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: background 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.notification-item:hover {
  background: var(--cream);
}

.notification-item.unread {
  background: #f4f8fb;
}

.notification-item.unread:hover {
  background: #eaf1f6;
}

.notification-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--green2);
  color: var(--green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.notification-icon-box svg {
  width: 16px;
  height: 16px;
  stroke: var(--green);
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
}

.notification-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 10px;
  color: var(--green);
  font-weight: 600;
}

/* ==========================================================================
   SIDEBAR RETRÁTIL INTELIGENTE (HOVER EXPANSION & PIN)
   ========================================================================== */
.app-global-sidebar {
  width: var(--sidebar-collapsed);
  background: var(--ink);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease, padding 0.22s ease;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  z-index: 1000;
  padding: 16px 6px 14px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.app-global-sidebar:hover,
.app-global-sidebar.pinned {
  width: var(--sidebar-expanded);
  box-shadow: 6px 0 28px rgba(0, 0, 0, 0.45);
  z-index: 1050;
  padding: 16px 10px 14px 10px;
}

.sidebar-pin-container {
  min-height: 30px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: center;
}

.app-global-sidebar.pinned .sidebar-pin-container {
  justify-content: space-between;
}

.btn-pin-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c1d0d9;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.68rem;
  transition: all 0.15s ease;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-pin-action:hover {
  background: var(--green);
  color: var(--white);
  border-color: #38bdf8;
}

.sidebar-category {
  margin-bottom: 14px;
}

.sidebar-section-label {
  color: #8ba3b2;
  font-size: 0.65rem;
  letter-spacing: 1.4px;
  font-weight: 700;
  text-transform: uppercase;
  padding-left: 8px;
  margin-bottom: 6px;
  display: none;
  white-space: nowrap;
}

.app-global-sidebar:hover .sidebar-section-label,
.app-global-sidebar.pinned .sidebar-section-label {
  display: block;
  animation: fadeIn 0.18s ease forwards;
}

.app-nav-link {
  color: #c1d0d9;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.42rem 0.75rem;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  width: 100%;
}

.app-global-sidebar:not(:hover):not(.pinned) .app-nav-link {
  justify-content: center;
  padding: 0.5rem 0;
}

.app-nav-link svg, .app-nav-link i {
  font-size: 0.95rem;
  color: #8ba3b2;
  transition: all 0.15s ease;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.app-nav-link .nav-text {
  color: #c1d0d9;
  transition: color 0.15s ease;
  margin-left: 8px;
  display: none;
}

.app-global-sidebar:hover .app-nav-link .nav-text,
.app-global-sidebar.pinned .app-nav-link .nav-text {
  display: inline;
}

.app-nav-link:hover {
  color: var(--white);
  background-color: var(--green);
}

.app-nav-link:hover svg,
.app-nav-link:hover .nav-text {
  color: var(--white);
}

.app-nav-link.active {
  color: var(--white);
  background-color: var(--green);
  box-shadow: inset 3px 0 #b8d0df;
}

.app-nav-link.active svg,
.app-nav-link.active .nav-text {
  color: var(--white);
  font-weight: 600;
}

/* ==========================================================================
   CARDS DE MÉTRICAS & KPIS (STAT CARDS)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--border-radius-md);
  background: var(--white);
  box-shadow: var(--shadow-card);
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #b8d0df;
  box-shadow: var(--shadow-hover);
}

.stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  display: block;
  margin: 6px 0 2px;
  font: 700 23px var(--font-title);
  color: var(--ink);
  letter-spacing: -0.5px;
}

.stat-value.mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   PAINÉIS & CONTAINERS
   ========================================================================== */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h2, .panel-header h3 {
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* ==========================================================================
   PIPELINE DE ETAPAS INTERATIVO
   ========================================================================== */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.pipeline-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--border-radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 86px;
}

.pipeline-card:hover {
  background: var(--white);
  border-color: var(--green);
  transform: translateY(-1px);
}

.pipeline-card.active {
  background: var(--green2);
  border: 2px solid var(--green);
  box-shadow: 0 4px 12px rgba(40, 90, 123, 0.15);
}

.pipeline-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-card-count {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
}

.pipeline-card-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.pipeline-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   CARROSSEL DO PORTFÓLIO DE SHOPPINGS
   ========================================================================== */
.portfolio-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 155px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.mall-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.15s ease;
  min-height: 135px;
  cursor: pointer;
}

.mall-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.mall-logo-box {
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 60px;
  margin-bottom: 8px;
}

.mall-logo-box img {
  max-width: 100px;
  max-height: 52px;
  object-fit: contain;
}

.mall-card-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.mall-card-loc {
  font-size: 8.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 3px;
}

/* ==========================================================================
   TABELAS CORPORATIVAS (DATA TABLE)
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f5;
  font-size: 12px;
  color: var(--ink);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: #f8fafb;
}

.data-table .code-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green);
  font-size: 11.5px;
}

.data-table .title-cell strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.data-table .title-cell small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.stat-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--green2);
  color: var(--green);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-icon-circle svg {
  width: 18px;
  height: 18px;
  stroke: var(--green);
}

/* ==========================================================================
   PAINÉIS & CONTAINERS
   ========================================================================== */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* ==========================================================================
   BADGES & PILLS — PADRÃO SOUL MALLS (AZUL, BRANCO E CINZA)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--border-radius-pill);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.status-solicitacao   { background: var(--cream); color: var(--muted); border: 1px solid var(--line); }
.badge.status-aprovacao     { background: var(--white); color: var(--ink-light); border: 1px solid var(--line); }
.badge.status-cotacao       { background: var(--green2); color: var(--green); border: 1px solid var(--line); }
.badge.status-kickoff       { background: var(--cream); color: var(--ink); border: 1px solid var(--line); }
.badge.status-execucao      { background: var(--green2); color: var(--green); border: 1px solid #cbdde9; }
.badge.status-concluido     { background: #edf4f8; color: var(--ink); border: 1px solid var(--line); }
.badge.status-suspenso      { background: var(--cream); color: var(--muted); border: 1px solid var(--line); }
.badge.status-cancelado     { background: var(--cream); color: var(--muted); border: 1px solid var(--line); }

/* ==========================================================================
   BOTÕES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--border-radius);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--green);
  border: 1px solid var(--green);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(40, 90, 123, 0.2);
}

.btn-primary:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
  box-shadow: 0 4px 10px rgba(40, 90, 123, 0.3);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--cream);
  border-color: var(--green);
  color: var(--green);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  border-radius: var(--border-radius-sm);
}

/* ==========================================================================
   ANIMAÇÕES
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ==========================================================================
   COMPONENTES GENÉRICOS ADICIONAIS
   ========================================================================== */

/* Theme Switcher Pill */
.theme-switcher-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--border-radius-pill);
  padding: 3px;
  gap: 4px;
}

.theme-pill-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
}

.theme-pill-btn:hover {
  transform: scale(1.15);
}

.theme-pill-btn.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 1px var(--ink);
}

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

.toast-item {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-hover);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeInDown 0.25s ease;
  font-size: 12.5px;
}

.toast-item.success { border-left: 4px solid var(--color-success); }
.toast-item.info    { border-left: 4px solid var(--color-info); }
.toast-item.warning { border-left: 4px solid var(--color-warning); }
.toast-item.error   { border-left: 4px solid var(--color-danger); }

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(40, 90, 123, 0.15);
}

/* Text Brand Fallback (quando não há imagem de logo) */
.brand-badge-generic {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--ink-light));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ==========================================================================
   MODAIS & DIÁLOGOS (FUNDO SÓLIDO BRANCO & BACKDROP ESCURECIDO)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 30, 45, 0.70);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff !important;
  border: 1px solid var(--line);
  border-radius: var(--border-radius-md);
  box-shadow: 0 24px 70px rgba(10, 30, 45, 0.45);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 2010;
  animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff !important;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.3px;
}

.modal-close-btn {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  background: #ffffff !important;
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

/* ==========================================================================
   RESPONSIVIDADE (tablet <=1024px, mobile <=768px/480px) - critério de aceite
   da interface web: nenhuma regra existia antes disso (só o shell/header/
   seletor de Shopping, pensados para desktop, precisavam de ajuste; stats-grid
   e table-responsive já eram responsivos por natureza - auto-fit/overflow-x).
   ========================================================================== */
@media (max-width: 1024px) {
  .saas-main-viewport {
    padding: 18px 16px 32px;
  }
}

@media (max-width: 768px) {
  .app-global-header {
    padding: 0 12px;
    gap: 8px;
  }

  .header-subtitle {
    display: none;
  }

  .shopping-selector-btn {
    padding: 0 10px;
    gap: 6px;
    max-width: 150px;
  }

  .shopping-selector-btn .micro-text {
    display: none;
  }

  .shopping-active-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-title-box {
    display: none;
  }

  .brand-divider {
    display: none;
  }

  .shopping-selector-btn {
    max-width: 120px;
  }

  .shopping-active-name {
    max-width: 80px;
  }
}
