/* CSS Variáveis - Design System */
:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Cores - Dark Mode Premium */
  --bg-main: #0B0F19;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-sidebar: #0f1422;
  --bg-input: #1f2937;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #06b6d4;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Acentos de Status */
  --color-empenhado: #3b82f6; /* Azul */
  --color-empenhado-bg: rgba(59, 130, 246, 0.15);
  
  --color-liquidado: #eab308; /* Amarelo/Dourado */
  --color-liquidado-bg: rgba(234, 179, 8, 0.15);
  
  --color-pago: #10b981; /* Verde/Esmeralda */
  --color-pago-bg: rgba(16, 185, 129, 0.15);

  --color-pendente: #ef4444; /* Vermelho */
  --color-pendente-bg: rgba(239, 68, 68, 0.15);

  --color-parcial: #f97316; /* Laranja */
  --color-parcial-bg: rgba(249, 115, 22, 0.15);

  --color-accent: #06b6d4; /* Turquesa */
  --color-accent-hover: #0891b2;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --sidebar-width: 280px;
}

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

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

/* Layout Geral da App */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Barra Lateral (Sidebar) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
  z-index: 50;
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.logo-icon {
  color: var(--color-accent);
  width: 28px;
  height: 28px;
}

.close-sidebar-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.close-sidebar-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.sidebar-section {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.global-vision-btn:hover {
  background: rgba(6, 182, 212, 0.15) !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.global-vision-btn:not(.active) {
  background: transparent !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

.global-vision-btn:not(.active):hover {
  color: var(--text-primary) !important;
  border-color: var(--text-secondary) !important;
}

.sidebar-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 700;
}

.control-group {
  margin-bottom: 16px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

select:focus {
  border-color: var(--border-focus);
}

.list-section {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

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

.section-header h3 {
  margin-bottom: 0;
}

.add-fav-btn {
  background: rgba(6, 182, 212, 0.1);
  border: 1px dashed rgba(6, 182, 212, 0.3);
  color: var(--color-accent);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.add-fav-btn:hover {
  background: var(--color-accent);
  color: var(--bg-main);
  border-style: solid;
}

.add-fav-btn svg {
  width: 16px;
  height: 16px;
}

.category-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section-card-header .category-filter-pills {
  margin-bottom: 0;
}

.category-filter-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.category-filter-btn.active {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-badge.category-representado {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-pago);
}

.category-badge.category-outro {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.category-badge:hover {
  filter: brightness(1.2);
}

.supplier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.supplier-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.supplier-item:hover, .supplier-item.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-accent);
}

.supplier-item.active {
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.1);
}

.supplier-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.supplier-item-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.edit-fav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: all var(--transition-fast);
}

.supplier-item:hover .edit-fav-btn {
  opacity: 1;
}

.edit-fav-btn:hover {
  color: var(--color-accent);
  background: rgba(6, 182, 212, 0.1);
}

.edit-fav-btn svg {
  width: 16px;
  height: 16px;
}

.supplier-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.supplier-item-cnpj {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.remove-fav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: all var(--transition-fast);
}

.supplier-item:hover .remove-fav-btn {
  opacity: 1;
}

.remove-fav-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.remove-fav-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-footer {
  padding: 16px 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

/* Área de Conteúdo Principal */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

/* Topbar */
.topbar {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-right: 16px;
  transition: background var(--transition-fast);
}

.menu-toggle-btn:hover {
  background: var(--bg-input);
}

.page-title h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 600px;
}

.page-title p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.refresh-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.refresh-btn svg {
  width: 18px;
  height: 18px;
}

/* Dashboard Body */
.dashboard-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Grid de KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: 20px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.empenhado::before { background-color: var(--color-empenhado); }
.kpi-card.liquidado::before { background-color: var(--color-liquidado); }
.kpi-card.pago::before { background-color: var(--color-pago); }

.kpi-icon-wrapper {
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empenhado .kpi-icon-wrapper {
  background: var(--color-empenhado-bg);
  color: var(--color-empenhado);
}

.liquidado .kpi-icon-wrapper {
  background: var(--color-liquidado-bg);
  color: var(--color-liquidado);
}

.pago .kpi-icon-wrapper {
  background: var(--color-pago-bg);
  color: var(--color-pago);
}

.kpi-info {
  flex-grow: 1;
}

.kpi-info span {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.kpi-info h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.kpi-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0;
  transition: width var(--transition-normal);
}

.liquidado .progress-bar { background-color: var(--color-liquidado); }
.pago .progress-bar { background-color: var(--color-pago); }

/* Seção de Gráficos */
.charts-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  min-width: 0;
  width: 100%;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  min-width: 0;
  width: 100%;
}

.chart-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.chart-container {
  position: relative;
  height: 320px;
  width: 100%;
  min-width: 0;
}

/* Cards e Tabelas de Empenhos */
.empenhos-section {
  width: 100%;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.section-card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.section-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.search-filter {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-filter svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-filter input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-filter input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.1);
}

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

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

.empenhos-table th {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.empenhos-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.empenhos-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.obj-cell {
  max-width: 320px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.val-text {
  font-weight: 600;
  font-size: 0.875rem;
}

.val-text.val-empenhado { color: var(--color-empenhado); }
.val-text.val-liquidado { color: var(--color-liquidado); }
.val-text.val-pago { color: var(--color-pago); }

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--bg-main);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.3);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--text-secondary);
}

.btn-action {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-action svg {
  width: 16px;
  height: 16px;
}

/* Cards Responsivos (Celular) */
.cards-responsive-list {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.responsive-empenho-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.r-card-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.r-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.r-card-obj {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.r-card-values {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
}

.r-card-val {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.r-card-val label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.r-card-val span {
  font-size: 0.8rem;
  font-weight: 700;
}

/* Modais */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  transition: opacity var(--transition-fast);
}

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

.modal {
  background: #0f1422;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalEnter var(--transition-normal);
}

.modal.modal-lg {
  max-width: 800px;
  max-height: 80vh;
}

@keyframes modalEnter {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
  max-width: 650px;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.close-modal-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-group input:focus {
  border-color: var(--border-focus);
}

.form-group small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Modais Grandes (KPIs e Abas) */
.modal-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.m-kpi {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.m-kpi span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.m-kpi strong {
  font-size: 1.15rem;
  font-weight: 800;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 24px;
  margin-bottom: 24px;
}

/* Abas de Entidades */
.entity-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.entity-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.entity-tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.entity-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.entity-tab-btn.active {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  padding-bottom: 12px;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--color-accent);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Linha do Tempo (Chronological Timeline) */
.timeline-wrapper {
  position: relative;
  padding: 10px 0;
}

.timeline {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-left: 54px;
  margin-bottom: 24px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-badge {
  position: absolute;
  left: 8px;
  top: 2px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 0 4px #0f1422;
}

.timeline-badge svg {
  width: 14px;
  height: 14px;
}

.timeline-badge.badge-liq {
  background: var(--color-liquidado-bg);
  color: var(--color-liquidado);
  border: 1.5px solid var(--color-liquidado);
}

.timeline-badge.badge-pag {
  background: var(--color-pago-bg);
  color: var(--color-pago);
  border: 1.5px solid var(--color-pago);
}

.timeline-content {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
}

.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.tl-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.tl-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tl-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.tl-val {
  font-size: 0.9rem;
  font-weight: 800;
}

.tl-val.val-liq { color: var(--color-liquidado); }
.tl-val.val-pag { color: var(--color-pago); }

/* Dados Detalhados Colunas */
.details-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.details-column {
  min-width: 0;
}

.details-column h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 8px;
}

.details-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.details-list-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.details-list-item span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.details-list-item strong {
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-pill.status-pago {
  background: var(--color-pago-bg);
  color: var(--color-pago);
}

.status-pill.status-parcial {
  background: var(--color-parcial-bg);
  color: var(--color-parcial);
}

.status-pill.status-pendente {
  background: var(--color-pendente-bg);
  color: var(--color-pendente);
}

.status-pill.status-indeterminado {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.details-list-item .saldo-pendente {
  color: var(--color-pendente);
}

.details-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-align: center;
}

.details-empty i {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

.details-empty span {
  font-size: 0.8rem;
}

/* Estado Vazio */
.empty-state {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  text-align: center;
  max-width: 480px;
  margin: auto;
}

.empty-icon {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Responsividade Mobile e Tablet */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .close-sidebar-btn {
    display: flex;
  }
  
  .menu-toggle-btn {
    display: flex;
  }
  
  .topbar {
    padding: 16px 20px;
  }
  
  .page-title h1 {
    font-size: 1.25rem;
    max-width: 280px;
  }
  
  .dashboard-body {
    padding: 20px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  /* Tabela some, entram os cards */
  .table-responsive {
    display: none;
  }
  
  .cards-responsive-list {
    display: flex;
  }
  
  .section-card-header {
    padding: 16px;
  }
  
  .search-filter {
    max-width: 100%;
  }
  
  .details-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .modal-kpi-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .modal.modal-lg {
    max-height: 90vh;
  }
  
  .timeline::before {
    left: 14px;
  }
  
  .timeline-item {
    padding-left: 40px;
  }
  
  .timeline-badge {
    left: 2px;
  }

  .chart-container {
    height: 240px;
  }
}

/* ==========================================================================
   TELA DE LOGIN (CONTRÔLE DE ACESSO - RBAC)
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal) ease-in-out;
}

.login-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(20px);
  transition: transform var(--transition-normal) ease;
}

.login-overlay.active .login-card {
  transform: translateY(0);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.login-footer strong {
  color: var(--color-accent);
}

/* ============================================================
   Histórico de Alterações / Feed de Novidades
   ============================================================ */

/* Selo com o número de empenhos alterados na última sincronização */
.changes-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--color-pendente);
  border-radius: var(--radius-full);
}

/* Realce de empenho novo/alterado na tabela e nos cards */
.empenho-changed-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-accent);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-full);
  vertical-align: middle;
}

.empenho-row-changed {
  background: rgba(6, 182, 212, 0.06);
}

/* Feed de alterações (modal do fornecedor e aba Novidades) */
.changes-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.changes-feed-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 32px 16px;
}

.changes-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.changes-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.changes-group-header i {
  width: 14px;
  height: 14px;
}

.changes-group-count {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.change-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-sm);
}

.change-item-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.change-item-icon i {
  width: 16px;
  height: 16px;
}

.change-item-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.change-item-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.change-item-desc {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.change-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Cores por tipo de alteração */
.change-empenho-novo { border-left-color: var(--color-empenhado); }
.change-empenho-novo .change-item-icon { color: var(--color-empenhado); background: var(--color-empenhado-bg); }

.change-liquidacao-nova { border-left-color: var(--color-liquidado); }
.change-liquidacao-nova .change-item-icon { color: var(--color-liquidado); background: var(--color-liquidado-bg); }

.change-pagamento-novo { border-left-color: var(--color-pago); }
.change-pagamento-novo .change-item-icon { color: var(--color-pago); background: var(--color-pago-bg); }

.change-valor-alterado { border-left-color: var(--color-parcial); }
.change-valor-alterado .change-item-icon { color: var(--color-parcial); background: var(--color-parcial-bg); }

.change-cadastro-alterado { border-left-color: var(--color-accent); }
.change-cadastro-alterado .change-item-icon { color: var(--color-accent); background: rgba(6, 182, 212, 0.12); }

/* Bloco Resumo / Detalhado */
.changes-view-toggle {
  margin-bottom: 16px;
}

/* Tabela de somatória de alterações: compacta para caber no modal sem cortar a última coluna */
.changes-summary-table {
  font-size: 0.8rem;
}

.changes-summary-table th,
.changes-summary-table td {
  padding: 10px 8px;
}

.changes-summary-table th:nth-child(2),
.changes-summary-table td:nth-child(2) {
  min-width: 140px;
}

.changes-summary-table th.cs-num,
.changes-summary-table td.cs-num {
  text-align: right;
  white-space: nowrap;
}

.changes-summary-table td.cs-zero {
  color: var(--text-muted);
}

.changes-summary-table tfoot td {
  border-top: 2px solid var(--border-color);
  background: var(--bg-input);
}

.changes-summary .table-responsive {
  max-height: 42vh;
  overflow: auto;
}

.changes-summary-section + .changes-summary-section {
  margin-top: 24px;
}

.changes-summary-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* Selo do tipo consolidado (prioridade a pagamentos) */
.tipo-pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
}

.tipo-pill.tp-pagamento {
  color: var(--color-pago);
  background: var(--color-pago-bg);
  border-color: var(--color-pago);
}

.tipo-pill.tp-liquidacao {
  color: var(--color-liquidado);
  background: var(--color-liquidado-bg);
  border-color: var(--color-liquidado);
}

.tipo-pill.tp-empenho {
  color: var(--color-empenhado);
  background: var(--color-empenhado-bg);
  border-color: var(--color-empenhado);
}

/* ============================================================
   Calendário de Lançamentos
   ============================================================ */
.calendar-card { padding: 20px; }

.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.calendar-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-toolbar-group > label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.calendar-toolbar select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  max-width: 280px;
}

.calendar-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cal-type-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  cursor: pointer;
}
.cal-type-check input { accent-color: currentColor; }
.cal-type-check.cal-type-pagamento { color: var(--color-pago); }
.cal-type-check.cal-type-liquidacao { color: var(--color-liquidado); }
.cal-type-check.cal-type-empenho { color: var(--color-empenhado); }

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.calendar-period-label {
  font-size: 1rem;
  font-weight: 700;
  text-transform: capitalize;
  min-width: 180px;
  text-align: center;
}

.calendar-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.cal-total-card {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--text-muted);
  background: var(--bg-input);
}
.cal-total-card strong { font-size: 1.1rem; }
.cal-total-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.cal-total-count { font-size: 0.7rem; color: var(--text-muted); }

.cal-pagamento { --cal-color: var(--color-pago); }
.cal-liquidacao { --cal-color: var(--color-liquidado); }
.cal-empenho { --cal-color: var(--color-empenhado); }
.cal-total-card.cal-pagamento { border-left-color: var(--color-pago); }
.cal-total-card.cal-liquidacao { border-left-color: var(--color-liquidado); }
.cal-total-card.cal-empenho { border-left-color: var(--color-empenhado); }
.cal-total-card.cal-pagamento strong { color: var(--color-pago); }
.cal-total-card.cal-liquidacao strong { color: var(--color-liquidado); }
.cal-total-card.cal-empenho strong { color: var(--color-empenhado); }

/* Mês */
.cal-weekhead, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-weekhead {
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  padding-right: 4px;
}
.cal-cell {
  min-height: 84px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.cal-cell:hover { border-color: var(--color-accent); }
.cal-cell-muted { opacity: 0.4; }
.cal-cell-today { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.cal-cell-selected { border-color: var(--color-accent); background: rgba(6,182,212,0.08); }
.cal-cell-date { font-size: 0.75rem; font-weight: 700; text-align: right; color: var(--text-secondary); }
.cal-day-line {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-day-line.cal-pagamento { color: var(--color-pago); background: var(--color-pago-bg); }
.cal-day-line.cal-liquidacao { color: var(--color-liquidado); background: var(--color-liquidado-bg); }
.cal-day-line.cal-empenho { color: var(--color-empenhado); background: var(--color-empenhado-bg); }

.cal-daydetail { margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 16px; }
.cal-detail-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; text-transform: capitalize; }
.cal-detail-totals, .cal-weekcol-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
}
.cal-inline-total {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.cal-inline-total.cal-pagamento { color: var(--color-pago); background: var(--color-pago-bg); }
.cal-inline-total.cal-liquidacao { color: var(--color-liquidado); background: var(--color-liquidado-bg); }
.cal-inline-total.cal-empenho { color: var(--color-empenhado); background: var(--color-empenhado-bg); }

.cal-detail-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cal-item {
  display: grid;
  grid-template-columns: 104px 88px 140px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.cal-item.cal-pagamento { border-left-color: var(--color-pago); }
.cal-item.cal-liquidacao { border-left-color: var(--color-liquidado); }
.cal-item.cal-empenho { border-left-color: var(--color-empenhado); }
.cal-item-badge { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-muted); }
.cal-item-date { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }
.cal-item-city { font-size: 0.75rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.cal-item-val { text-align: right; white-space: nowrap; }
.cal-item.cal-pagamento .cal-item-val { color: var(--color-pago); }
.cal-item.cal-liquidacao .cal-item-val { color: var(--color-liquidado); }
.cal-item.cal-empenho .cal-item-val { color: var(--color-empenhado); }
.cal-empty { color: var(--text-muted); font-size: 0.8rem; text-align: center; padding: 8px; }

/* Semana */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
}
.cal-weekcol {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cal-weekcol-head { font-size: 0.78rem; color: var(--text-secondary); }
.cal-weekcol .cal-detail-list { gap: 6px; }
.cal-weekcol .cal-item {
  grid-template-columns: 1fr;
  gap: 3px;
  font-size: 0.75rem;
}
.cal-weekcol .cal-item-val { text-align: left; }

/* Dia */
.cal-day { padding-top: 4px; }

@media (max-width: 720px) {
  .cal-cell { min-height: 64px; }
  .cal-item { grid-template-columns: 1fr; gap: 3px; }
  .cal-item-val { text-align: left; }
}

/* Recebimentos por fornecedor (rodapé do calendário) */
.calendar-recap {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cal-recap-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: capitalize;
}
.cal-recap-group h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid var(--text-muted);
}
.cal-recap-group.cal-pagamento h4 { border-left-color: var(--color-pago); color: var(--color-pago); }
.cal-recap-group.cal-liquidacao h4 { border-left-color: var(--color-liquidado); color: var(--color-liquidado); }
.cal-recap-group .table-responsive { max-height: 40vh; overflow: auto; }

/* =====================================================================
   Módulo de Configurações de Usuários (RBAC)
   ===================================================================== */
.modal-xl {
  max-width: 980px;
  width: 95%;
}

.modal-md {
  max-width: 540px;
  width: 90%;
}

.user-config-btn {
  transition: all var(--transition-fast);
}

.user-config-btn:hover {
  background: rgba(6, 182, 212, 0.15) !important;
  border-color: var(--color-accent) !important;
  color: var(--color-accent) !important;
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.users-stats-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-stat-pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.user-stat-pill strong {
  color: var(--text-primary);
  margin-left: 2px;
}

.user-stat-pill.stat-admin {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.1);
  color: #c4b5fd;
}

.user-stat-pill.stat-master {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.1);
  color: #67e8f9;
}

.user-stat-pill.stat-comum {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
}

.users-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.users-search-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.82rem;
  outline: none;
  min-width: 220px;
  transition: border-color var(--transition-fast);
}

.users-search-input:focus {
  border-color: var(--border-focus);
}

/* Badges de Perfis de Usuário */
.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-role-admin {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.badge-role-master {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-role-comum {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Lista de Cidades Autorizadas */
.munis-badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 320px;
}

.muni-pill {
  font-size: 0.7rem;
  background: var(--bg-input);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.muni-pill.muni-all {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
  font-weight: 600;
}

/* Checkbox Grid no Modal de Criação */
.municipalities-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.muni-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.muni-checkbox-item:hover {
  border-color: var(--color-accent);
  background: rgba(6, 182, 212, 0.08);
}

.muni-checkbox-item input[type="checkbox"] {
  accent-color: var(--color-accent);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.btn-text-sm {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.btn-text-sm:hover {
  background: rgba(6, 182, 212, 0.15);
}

/* Responsividade para Lista de Usuários */
@media (max-width: 768px) {
  .users-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .users-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .users-search-input {
    width: 100%;
  }
}

