/* ════════════════════════════════════════════════════════════════════════════
   CENTRAL REDES SUITE — DESIGN SYSTEM & TOKENS VISUAIS OFICIAIS
   Folha de estilos padrão para módulos, plugins e microsserviços integrados.
   Importe este arquivo no seu módulo ou use estas variáveis como guia visual.
════════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* ─── PALETA DE CORES PRINCIPAL ─── */
  --redes-primary: #1e6550;            /* Verde Floresta Nobre (Ações Principais, Botões, Destaques) */
  --redes-primary-hover: #164d3d;      /* Verde Escurecido para Hover */
  --redes-primary-light: #e9f2e7;      /* Fundo sutil para chips e seleções */
  --redes-ink: #173f37;                /* Verde Profundo (Sidebar, Títulos H1/H2, Textos Enfatizados) */
  --redes-dark: #102924;               /* Quase Preto Botânico */
  
  /* ─── FUNDOS E SUPERFÍCIES ─── */
  --redes-bg: #f5f5ef;                 /* Fundo Geral da Plataforma (Areia/Off-White Sofisticado) */
  --redes-surface: #ffffff;            /* Fundo de Painéis, Cards e Modais */
  --redes-surface-alt: #f8faf7;        /* Fundo de seções secundárias e cabeçalhos de tabela */
  
  /* ─── LINHAS E BORDAS ─── */
  --redes-line: #dee5da;               /* Bordas sutis de cartões e divisores */
  --redes-line-dark: #bad084;          /* Borda ativa / Verde Oliva de realce */
  
  /* ─── CORES DE REALCE (ACCENTS) ─── */
  --redes-accent-lime: #bad084;        /* Verde Lima Sutil (Badges ativos, bordas selecionadas) */
  --redes-accent-peach: #e9a47e;       /* Pêssego/Coral Dourado (Gamificação e Alertas) */
  --redes-accent-gold: #e6b772;        /* Dourado para Prêmios e Gamificação */
  
  /* ─── TEXTOS E TIPOGRAFIA ─── */
  --redes-text: #233d37;               /* Texto Padrão de Parágrafos */
  --redes-muted: #6c7b75;              /* Texto Secundário, Descrições, Legendas */
  --redes-subtle: #8ba08d;             /* Placeholders, Ícones inativos */
  
  /* ─── STATUS DO SISTEMA ─── */
  --redes-success-bg: #dcfce7;
  --redes-success-text: #15803d;
  --redes-warning-bg: #fef3c7;
  --redes-warning-text: #b45309;
  --redes-danger-bg: #fee2e2;
  --redes-danger-text: #b91c1c;
  --redes-info-bg: #eff6ff;
  --redes-info-text: #1d4ed8;

  /* ─── FONTES ─── */
  --redes-font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --redes-font-display: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;

  /* ─── RAIO DE BORDA (BORDER-RADIUS) ─── */
  --redes-radius-sm: 6px;
  --redes-radius-md: 10px;
  --redes-radius-lg: 14px;
  --redes-radius-pill: 9999px;

  /* ─── SOMBRAS (ELEVATION) ─── */
  --redes-shadow-sm: 0 1px 3px rgba(23, 63, 55, 0.05);
  --redes-shadow-md: 0 4px 14px rgba(23, 63, 55, 0.07);
  --redes-shadow-lg: 0 10px 25px rgba(23, 63, 55, 0.10);
  --redes-shadow-hover: 0 8px 24px rgba(30, 101, 80, 0.12);
}

/* ─── RESET E BASE ─── */
body.redes-theme {
  font-family: var(--redes-font-main);
  background-color: var(--redes-bg);
  color: var(--redes-text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* ─── TIPOGRAFIA PADRONIZADA ─── */
.redes-title-1 {
  font-family: var(--redes-font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--redes-ink);
  letter-spacing: -0.6px;
  margin: 0 0 6px 0;
}

.redes-title-2 {
  font-family: var(--redes-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--redes-ink);
  letter-spacing: -0.3px;
  margin: 0 0 4px 0;
}

.redes-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--redes-primary);
  margin-bottom: 4px;
}

.redes-muted {
  color: var(--redes-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ─── BOTÃO OFICIAL: VOLTAR À CENTRAL REDES ─── */
.redes-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--redes-surface);
  color: var(--redes-primary);
  border: 1px solid var(--redes-line);
  border-radius: var(--redes-radius-pill);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--redes-shadow-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}

.redes-back-btn:hover {
  background: var(--redes-primary-light);
  border-color: var(--redes-accent-lime);
  color: var(--redes-primary-hover);
  transform: translateY(-1px);
}

/* ─── BOTÕES DA INTERFACE ─── */
.redes-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-family: var(--redes-font-main);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--redes-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.redes-btn-primary {
  background: var(--redes-primary);
  color: #ffffff;
  border-color: var(--redes-primary);
  box-shadow: 0 2px 6px rgba(30, 101, 80, 0.2);
}

.redes-btn-primary:hover {
  background: var(--redes-primary-hover);
  border-color: var(--redes-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 101, 80, 0.3);
}

.redes-btn-secondary {
  background: var(--redes-surface);
  color: var(--redes-ink);
  border-color: var(--redes-line);
}

.redes-btn-secondary:hover {
  background: var(--redes-surface-alt);
  border-color: var(--redes-accent-lime);
}

.redes-btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.redes-btn-danger:hover {
  background: #fecaca;
  color: #991b1b;
}

/* ─── PAINÉIS E CARDS ─── */
.redes-panel {
  background: var(--redes-surface);
  border: 1px solid var(--redes-line);
  border-radius: var(--redes-radius-lg);
  padding: 24px;
  box-shadow: var(--redes-shadow-sm);
  margin-bottom: 24px;
}

.redes-card {
  background: var(--redes-surface);
  border: 1px solid var(--redes-line);
  border-radius: var(--redes-radius-lg);
  padding: 20px;
  box-shadow: var(--redes-shadow-sm);
  transition: all 0.25s ease;
}

.redes-card:hover {
  transform: translateY(-2px);
  border-color: var(--redes-accent-lime);
  box-shadow: var(--redes-shadow-hover);
}

/* ─── KPI CARDS (MÉTRICAS) ─── */
.redes-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.redes-kpi-card {
  background: var(--redes-surface);
  border: 1px solid var(--redes-line);
  border-radius: var(--redes-radius-md);
  padding: 18px 20px;
  box-shadow: var(--redes-shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}

.redes-kpi-val {
  font-size: 26px;
  font-weight: 700;
  color: var(--redes-ink);
  line-height: 1.1;
  margin-bottom: 2px;
}

.redes-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--redes-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── BADGES E STATUS PILLS ─── */
.redes-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--redes-radius-pill);
  font-size: 11px;
  font-weight: 600;
}

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

.redes-badge-warning {
  background: var(--redes-warning-bg);
  color: var(--redes-warning-text);
  border: 1px solid #fde68a;
}

.redes-badge-danger {
  background: var(--redes-danger-bg);
  color: var(--redes-danger-text);
  border: 1px solid #fecaca;
}

/* ─── FORMULÁRIOS & INPUTS ─── */
.redes-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--redes-ink);
}

.redes-input, .redes-select, .redes-textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--redes-font-main);
  font-size: 13.5px;
  color: var(--redes-text);
  background: var(--redes-surface);
  border: 1px solid var(--redes-line);
  border-radius: var(--redes-radius-md);
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

.redes-input:focus, .redes-select:focus, .redes-textarea:focus {
  border-color: var(--redes-primary);
  box-shadow: 0 0 0 3px rgba(30, 101, 80, 0.12);
}

/* ─── TABELAS DE DADOS (LEADS, REGISTROS) ─── */
.redes-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--redes-radius-md);
  border: 1px solid var(--redes-line);
}

.redes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--redes-surface);
  text-align: left;
}

.redes-table th {
  background: var(--redes-surface-alt);
  color: var(--redes-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--redes-line);
}

.redes-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2eb;
  color: var(--redes-text);
}

.redes-table tr:hover td {
  background: #fafcf8;
}

/* Tema escuro oficial: hierarquia grafite inspirada no Antigravity. */
:root[data-theme=dark] {
  color-scheme: dark;
  --redes-primary: #78e6c1;
  --redes-primary-hover: #91efd0;
  --redes-primary-surface: #1f745a;
  --redes-primary-light: rgba(120, 230, 193, 0.11);
  --redes-ink: #f5f7f6;
  --redes-dark: #090a09;
  --redes-bg: #090a09;
  --redes-surface: #171918;
  --redes-surface-alt: #1e211f;
  --redes-surface-raised: #252a27;
  --redes-surface-emphasis: #303532;
  --redes-surface-hover: #353b37;
  --redes-line: #3f4541;
  --redes-control-border: #6b746f;
  --redes-line-dark: rgba(117, 223, 189, 0.38);
  --redes-text: #f5f7f6;
  --redes-text-secondary: #d2d7d4;
  --redes-muted: #a8b0ab;
  --redes-subtle: #929b95;
  --redes-success-bg: rgba(34, 197, 94, 0.13);
  --redes-success-text: #86efac;
  --redes-warning-bg: rgba(245, 158, 11, 0.13);
  --redes-warning-text: #fcd34d;
  --redes-danger-bg: rgba(239, 68, 68, 0.13);
  --redes-danger-text: #fca5a5;
  --redes-info-bg: rgba(59, 130, 246, 0.13);
  --redes-info-text: #93c5fd;
  --redes-shadow-sm: inset 0 1px 0 rgba(255,255,255,.04), 0 2px 10px rgba(0,0,0,.22);
  --redes-shadow-md: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 36px rgba(0,0,0,.28);
  --redes-shadow-lg: inset 0 1px 0 rgba(255,255,255,.06), 0 24px 64px rgba(0,0,0,.38);
  --redes-shadow-hover: 0 16px 44px rgba(0,0,0,.42);
}

:root[data-theme=dark] body.redes-theme {
  background-color: var(--redes-bg);
  color: var(--redes-text);
  background-image: linear-gradient(rgba(255,255,255,.016) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.016) 1px, transparent 1px);
  background-size: 28px 28px;
}

:root[data-theme=dark] .redes-panel,
:root[data-theme=dark] .redes-card,
:root[data-theme=dark] .redes-kpi-card,
:root[data-theme=dark] .redes-table-wrap,
:root[data-theme=dark] .redes-table {
  background: var(--redes-surface);
  border-color: var(--redes-line);
}

:root[data-theme=dark] .redes-card:hover,
:root[data-theme=dark] .redes-panel:hover,
:root[data-theme=dark] .redes-kpi-card:hover {
  background: var(--redes-surface-hover);
  border-color: rgba(89,211,174,.48);
}

:root[data-theme=dark] :is(.redes-title-1,.redes-title-2,.redes-kpi-val) {color:var(--redes-text)}
:root[data-theme=dark] :is(.redes-muted,.redes-kpi-label,.redes-table th) {color:var(--redes-text-secondary)}
:root[data-theme=dark] .redes-back-btn,
:root[data-theme=dark] .redes-btn-secondary {
  background:var(--redes-surface-raised);
  color:var(--redes-text);
  border-color:var(--redes-control-border);
}
:root[data-theme=dark] :is(.redes-back-btn,.redes-btn-secondary):hover {background:var(--redes-surface-hover)}
:root[data-theme=dark] .redes-btn-primary {background:var(--redes-primary-surface);color:#fff;border-color:var(--redes-primary)}
:root[data-theme=dark] .redes-btn-danger {background:var(--redes-danger-bg);color:var(--redes-danger-text);border-color:rgba(252,165,165,.45)}
:root[data-theme=dark] :is(.redes-badge-active,.redes-badge-warning,.redes-badge-danger) {border-color:currentColor}
:root[data-theme=dark] .redes-field {color:var(--redes-text-secondary)}
:root[data-theme=dark] .redes-table th {background:var(--redes-surface-alt);border-color:var(--redes-line)}
:root[data-theme=dark] .redes-table td {background:var(--redes-surface);color:var(--redes-text);border-color:var(--redes-line)}
:root[data-theme=dark] .redes-table tr:hover td {background:var(--redes-surface-hover)}
:root[data-theme=dark] :is(.redes-input,.redes-select,.redes-textarea) {
  background: var(--redes-surface-raised);
  color: var(--redes-text);
  border-color: var(--redes-control-border);
}
:root[data-theme=dark] :is(.redes-input,.redes-select,.redes-textarea)::placeholder {color:var(--redes-muted);opacity:1}
