/* ===================================================================
   ProspectaEmpresa — Premium Mobile App UI
   Estilo: Modern E-commerce Dark Mode + Gradient Accents
   Inspiração: Revolut, Linear, Notion, Apple
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* ===== Backgrounds ===== */
  --bg:              #0f0f14;
  --bg-card:         #1a1a24;
  --bg-elevated:     #242432;
  --bg-input:        #0f0f14;

  /* ===== Borders (quase invisíveis, dão profundidade) ===== */
  --border:          rgba(255, 255, 255, 0.06);
  --border-strong:   rgba(255, 255, 255, 0.10);
  --border-focus:    #c56cf0;

  /* ===== Text ===== */
  --text:            #ffffff;
  --text-secondary:  #a1a1aa;
  --text-muted:      #71717a;

  /* ===== Gradientes ===== */
  --grad-primary:    linear-gradient(135deg, #ff6b9d 0%, #c56cf0 50%, #6c5ce7 100%);
  --grad-secondary:  linear-gradient(135deg, #ffa751 0%, #ff6b9d 100%);
  --grad-success:    linear-gradient(135deg, #00d9a3 0%, #00b4d8 100%);
  --grad-warning:    linear-gradient(135deg, #ffd93d 0%, #ff6b9d 100%);

  /* Accent individuais (para glow e usos soltos) */
  --pink:            #ff6b9d;
  --purple:          #c56cf0;
  --violet:          #6c5ce7;
  --orange:          #ffa751;
  --green:           #00d9a3;
  --blue:            #00b4d8;
  --yellow:          #ffd93d;
  --red:             #ff5a6a;

  /* ===== Sombras ===== */
  --shadow-card:     0 4px 24px rgba(108, 92, 231, 0.08);
  --shadow-card-hover: 0 8px 32px rgba(197, 108, 240, 0.16);
  --shadow-btn:      0 4px 16px rgba(255, 107, 157, 0.35);
  --shadow-btn-hover: 0 8px 24px rgba(255, 107, 157, 0.45);
  --shadow-modal:    0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.06);

  /* ===== Radius ===== */
  --r-card:          20px;
  --r-base:          16px;
  --r-btn:           14px;
  --r-input:         12px;
  --r-pill:          999px;
  --r-modal:         24px;

  /* ===== Transições ===== */
  --ease:            cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:          180ms var(--ease);
  --t-base:          240ms var(--ease);

  /* ===== Font ===== */
  --font:            'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;

  /* ===== Layout ===== */
  --sidebar-w:       300px;
}

/* ====== RESET ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  font-weight: 400;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Gradiente radial sutil no topo (apenas 5-8% opacity) */
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(197, 108, 240, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 0%, rgba(255, 107, 157, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
}

/* ====== LUCIDE ICONS — base ======
   Lucide injeta SVGs no lugar de <i data-lucide="...">.
   Por padrão o SVG herda currentColor; usamos width/height para controlar tamanho.
*/
[data-lucide],
.lucide,
svg.lucide {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 2;
}

/* Tamanhos base aplicados em todo SVG Lucide gerado */
i[data-lucide] + svg,
svg.lucide {
  width: 18px;
  height: 18px;
}

/* ---- Header principal (logo icon rosa->roxo->violeta) ---- */
.icon-header,
svg.lucide.icon-header,
.header-icon svg {
  width: 26px !important;
  height: 26px !important;
  color: #ffffff;
  stroke-width: 2.25;
}

/* ---- Hamburguer ---- */
.icon-hamburger,
svg.lucide.icon-hamburger {
  width: 26px !important;
  height: 26px !important;
  color: var(--text-secondary);
  stroke-width: 2.25;
}
.hamburger-btn[aria-expanded="true"] .icon-hamburger,
.hamburger-btn[aria-expanded="true"] svg.lucide { color: #fff; }

/* ---- Sidebar header ---- */
.icon-sidebar-header,
svg.lucide.icon-sidebar-header {
  width: 16px !important;
  height: 16px !important;
  color: var(--purple);
  stroke-width: 2.25;
}

/* ---- Ícones dentro de botões ---- */
.icon-btn,
svg.lucide.icon-btn {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.25;
}
.icon-btn-sm,
svg.lucide.icon-btn-sm {
  width: 15px !important;
  height: 15px !important;
}

/* ---- KPI cards — ícone no canto superior direito ---- */
.kpi-icon,
svg.lucide.kpi-icon {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 22px !important;
  height: 22px !important;
  color: var(--purple);
  opacity: 0.85;
  stroke-width: 2;
  z-index: 1;
}
/* Cores por variante de KPI (alinhadas ao gradient correspondente) */
.kpi-card .kpi-icon { color: #ff6b9d; }               /* Total — pink */
.kpi-card.kpi-success .kpi-icon { color: #00d9a3; }   /* Verde */
.kpi-card.kpi-accent  .kpi-icon { color: #ffa751; }   /* Laranja */
.kpi-card:nth-child(5) .kpi-icon { color: #c56cf0; }  /* Capital — roxo */

/* ---- Ícones de ordenação nas colunas ---- */
.sort-icon,
svg.lucide.sort-icon {
  width: 12px !important;
  height: 12px !important;
  opacity: 0.5;
  margin-left: 4px;
  color: currentColor;
  stroke-width: 2.5;
  vertical-align: middle;
}
.data-table th.sortable:hover .sort-icon { opacity: 1; }
.data-table th.sort-asc .sort-icon,
.data-table th.sort-desc .sort-icon {
  opacity: 1;
  color: var(--purple);
}
.th-inner {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* ---- Close do modal ---- */
.icon-modal-close,
svg.lucide.icon-modal-close {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.5;
}

/* ---- Ícones em títulos de seção do modal ---- */
.modal-section-icon,
svg.lucide.modal-section-icon {
  width: 16px !important;
  height: 16px !important;
  color: var(--purple);
  stroke-width: 2.25;
}

/* ---- Ícones em links inline (Ver no Maps, etc) ---- */
.icon-inline,
svg.lucide.icon-inline {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 2.25;
  vertical-align: middle;
  margin-right: 2px;
}

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ====== HAMBURGER (mobile) ====== */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 300;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 10px 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-card);
}
.hamburger-btn:hover {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(197, 108, 240, 0.12);
  transform: translateY(-1px);
}
.hamburger-btn[aria-expanded="true"] {
  background: var(--grad-primary);
  border-color: transparent;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 149;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.sidebar-overlay.active { display: block; }

/* ====== HEADER ====== */
.header {
  background: rgba(15, 15, 20, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}

.header-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-primary);
  border-radius: var(--r-base);
  box-shadow: var(--shadow-btn);
  flex-shrink: 0;
  color: #ffffff;
}

.header-title h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.header-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* ====== KPI CARDS ====== */
.kpi-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.kpi-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px 18px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--t-base);
  overflow: hidden;
}

.kpi-card:hover {
  border-color: rgba(197, 108, 240, 0.35);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.kpi-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding-right: 30px; /* espaço para o ícone absoluto */
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-value-sm {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* Variantes de KPI */
.kpi-success .kpi-value { background: var(--grad-success); -webkit-background-clip: text; background-clip: text; }
.kpi-accent  .kpi-value { background: var(--grad-secondary); -webkit-background-clip: text; background-clip: text; }

/* ====== LAYOUT ====== */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - 92px);
}

/* ====== SIDEBAR ====== */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: calc(100vh - 92px);
  position: sticky;
  top: 92px;
  align-self: start;
}

.sidebar-header {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.filter-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.filter-sublabel {
  font-size: 0.64rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
  letter-spacing: 0.02em;
}

.filter-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-range-item {
  display: flex;
  flex-direction: column;
}

.filter-input-mt { margin-top: 6px; }

/* ====== INPUTS ====== */
.filter-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.82rem;
  width: 100%;
  transition: all var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font);
  font-weight: 500;
}

.filter-input::placeholder { color: var(--text-muted); }

.filter-input:hover:not(:focus) {
  border-color: var(--border-strong);
}

.filter-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(197, 108, 240, 0.15);
  background: var(--bg-input);
}

.filter-input option { background: var(--bg-elevated); color: var(--text); }

select.filter-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-btn);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  font-family: var(--font);
  letter-spacing: -0.005em;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }

.btn-full { width: 100%; }

/* Primary — gradiente rosa → roxo → violeta */
.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  padding: 14px 22px;
  box-shadow: var(--shadow-btn);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-1px);
}

/* Ghost — sutil */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}

/* Success — gradiente verde → azul */
.btn-success {
  background: rgba(0, 217, 163, 0.1);
  color: var(--green);
  border-color: rgba(0, 217, 163, 0.25);
}
.btn-success:hover {
  background: var(--grad-success);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(0, 217, 163, 0.35);
  transform: translateY(-1px);
}

/* Accent (XLSX) — laranja → rosa */
.btn-accent {
  background: rgba(255, 167, 81, 0.1);
  color: var(--orange);
  border-color: rgba(255, 167, 81, 0.25);
}
.btn-accent:hover {
  background: var(--grad-secondary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.35);
  transform: translateY(-1px);
}

.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.export-label { width: 100%; margin-bottom: 4px; }

.btn-export { flex: 1; min-width: 80px; padding: 11px 14px; font-size: 0.78rem; }

/* ====== MAIN ====== */
.main-content {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ====== PROGRESS ====== */
.progress-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-base);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--r-pill);
  width: 30%;
  animation: progress-indeterminate 1.8s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0%   { transform: translateX(-100%); width: 40%; }
  50%  { transform: translateX(100%);  width: 60%; }
  100% { transform: translateX(300%);  width: 40%; }
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ====== TABLE STATUSBAR ====== */
.table-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 500;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.page-size-select {
  width: 86px;
  padding: 8px 12px;
  padding-right: 30px;
}

/* ====== SKELETON ====== */
.skeleton-row {
  height: 56px;
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-elevated) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--r-input);
  margin-bottom: 6px;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border: 1px solid var(--border);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ====== SPINNER ====== */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 72px;
  color: var(--text-secondary);
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid var(--border);
  border-top-color: var(--pink);
  border-right-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ====== TABLE ====== */
.table-wrapper {
  overflow-x: auto;
  background: transparent;
  padding: 4px 2px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 0.82rem;
  min-width: 1000px;
}

.data-table thead th {
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 16px;
  white-space: nowrap;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}
.data-table th.sortable:hover { color: var(--text); }
/* Variação do ícone de ordenação (Lucide arrow-up/arrow-down trocado via classe) */
.data-table th.sort-asc .sort-icon,
.data-table th.sort-desc .sort-icon { color: var(--purple); opacity: 1; }

.data-table tbody tr {
  transition: all var(--t-fast);
  cursor: pointer;
  background: var(--bg-card);
}
.data-table tbody tr:hover {
  background: var(--bg-elevated);
}

.data-table tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  position: relative;
}

.data-table tbody td:first-child {
  border-left: 1px solid var(--border);
  border-top-left-radius: var(--r-input);
  border-bottom-left-radius: var(--r-input);
}
.data-table tbody td:last-child {
  border-right: 1px solid var(--border);
  border-top-right-radius: var(--r-input);
  border-bottom-right-radius: var(--r-input);
}

/* Accent gradient border-left no hover */
.data-table tbody tr:hover td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--grad-primary);
  border-radius: var(--r-pill);
}

.row-success td:first-child::after {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--grad-success);
  border-radius: var(--r-pill);
  opacity: 0.6;
}

/* Links tabela */
.table-link {
  color: var(--purple);
  text-decoration: none;
  transition: all var(--t-fast);
  font-weight: 600;
}
.table-link:hover {
  color: var(--pink);
  text-decoration: underline;
  text-decoration-color: rgba(255, 107, 157, 0.5);
  text-underline-offset: 3px;
}

/* ====== BADGES (pill-shaped com gradient) ====== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.badge-success {
  background: var(--grad-success);
  box-shadow: 0 2px 8px rgba(0, 217, 163, 0.25);
}
.badge-danger {
  background: rgba(255, 90, 106, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 90, 106, 0.3);
  text-shadow: none;
}
.badge-warning {
  background: var(--grad-warning);
  color: #1a1a24;
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(255, 217, 61, 0.25);
}
.badge-neutral {
  background: rgba(161, 161, 170, 0.15);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-shadow: none;
}

/* Badges de porte */
.badge-mei {
  background: var(--grad-warning);
  color: #1a1a24;
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(255, 217, 61, 0.25);
}
.badge-me {
  background: var(--grad-primary);
  box-shadow: 0 2px 8px rgba(197, 108, 240, 0.25);
}
.badge-epp {
  background: var(--grad-secondary);
  box-shadow: 0 2px 8px rgba(255, 167, 81, 0.25);
}
.badge-demais {
  background: rgba(161, 161, 170, 0.15);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-shadow: none;
}
.badge-grande {
  background: var(--grad-success);
  box-shadow: 0 2px 8px rgba(0, 217, 163, 0.25);
}

/* Badge CNAE — mais sutil */
.badge-cnae {
  display: inline-block;
  background: rgba(108, 92, 231, 0.12);
  color: #b8a8ff;
  border: 1px solid rgba(108, 92, 231, 0.25);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.data-table th.num-col,
.data-table td.num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ====== PAGINATION ====== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.page-numbers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-input);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: var(--font);
  font-weight: 600;
}

.page-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.page-btn.active {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(197, 108, 240, 0.35);
  font-weight: 700;
}
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ====== EMPTY STATE ====== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.empty-state-icon {
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(197, 108, 240, 0.10);
  border: 1px solid rgba(197, 108, 240, 0.25);
}
.empty-state-icon svg.lucide {
  width: 36px !important;
  height: 36px !important;
  color: var(--purple);
  stroke-width: 1.75;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ====== MODAL ====== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.7);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 32px;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-modal);
  width: 100%;
  max-width: 760px;
  margin: auto;
  position: relative;
  box-shadow: var(--shadow-modal);
  animation: modal-in 280ms var(--ease);
  overflow: hidden;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  transition: all var(--t-fast);
  z-index: 2;
  padding: 0;
}
.modal-close:hover {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  transform: rotate(90deg);
}

#modal-content { padding: 32px 32px 0; }

.modal-footer {
  padding: 20px 32px 28px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-right: 48px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.modal-section { margin-bottom: 26px; }
.modal-section:last-child { margin-bottom: 0; }

.modal-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 14px 16px;
  transition: border-color var(--t-fast);
}

.modal-field:hover { border-color: var(--border-strong); }

.modal-field-full { grid-column: 1 / -1; }

.modal-field-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-field-value {
  font-size: 0.88rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* QSA */
.modal-socios {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-socio {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  flex-wrap: wrap;
  transition: border-color var(--t-fast);
}

.modal-socio:hover { border-color: rgba(197, 108, 240, 0.3); }

.modal-socio-nome {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text);
}

/* ====== FOOTER ====== */
.footer {
  text-align: center;
  padding: 22px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ====== RESPONSIVO ====== */
@media (max-width: 1280px) {
  :root { --sidebar-w: 260px; }
  .main-content { padding: 24px; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .modal-grid { grid-template-columns: 1fr; }
  .kpi-grid { gap: 10px; }
  .kpi-card { min-width: 110px; padding: 12px 14px; }
  .kpi-value { font-size: 1.4rem; }
}

@media (max-width: 768px) {
  .hamburger-btn { display: flex; }

  .header {
    padding: 14px 14px 14px 70px;
    gap: 12px;
  }

  .header-title h1  { font-size: 1.1rem; }
  .header-subtitle  { display: none; }
  .header-icon { width: 38px; height: 38px; }
  .header-icon svg.lucide.icon-header { width: 22px !important; height: 22px !important; }

  .kpi-grid { gap: 8px; }
  .kpi-card { min-width: 90px; padding: 10px 12px; }
  .kpi-card .kpi-icon { top: 10px; right: 12px; width: 18px !important; height: 18px !important; }
  .kpi-value    { font-size: 1.15rem; }
  .kpi-value-sm { font-size: 0.8rem; }
  .kpi-label    { font-size: 0.6rem; }

  .layout {
    grid-template-columns: 1fr;
    position: relative;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 88vw;
    height: 100vh;
    max-height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 320ms var(--ease);
    border-right: 1px solid var(--border);
    border-bottom: none;
    padding-top: 20px;
    overflow-y: auto;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
  }

  .sidebar.sidebar-open { transform: translateX(0); }

  .main-content { padding: 16px; gap: 14px; }

  .data-table    { min-width: 860px; }

  .modal-overlay { padding: 0; }
  .modal-card {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  #modal-content { padding: 22px 18px 0; }
  .modal-footer  { padding: 16px 18px 22px; }

  .modal-grid { grid-template-columns: 1fr; }

  .table-statusbar { flex-direction: column; align-items: flex-start; gap: 8px; }
}
