:root {
  /* Light Mode Color Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #e8eeff;
  
  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  /* cores base FEA*/
  --fea-azul-escuro: #111b47;
  --fea-azul-claro: #3643b1;
  --fea-roxo-claro: #667eea;
  --fea-roxo-escuro: #764ba2;
  --fea-azul-medio: #5a67d8;
  --fea-roxo-medio: #6b46c1;
  
  /* Accent Colors - Usando cores FEA */
  --accent-primary: var(--fea-azul-claro);
  --accent-primary-hover: var(--fea-azul-escuro);
  --accent-secondary: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;

  /* Border Colors */
  --border-primary: #e2e8f0;
  --border-secondary: #cbd5e1;
  --border-focus: var(--fea-roxo-claro);
  
  /* Shadow */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Dark Mode Color Palette - Baseado na página de login */
[data-theme="dark"] {
  /* Background Colors - Usando gradiente da página de login */
  --bg-primary: #1a1f3a;
  --bg-secondary: #111b47;
  --bg-tertiary: #0f1535;
  --bg-card: #1e2749;
  --bg-hover: #252d50;
  
  /* Text Colors */
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  /* Border Colors */
  --border-primary: #2d3651;
  --border-secondary: #3d4663;
  
  /* Shadow - Mais intenso em dark mode */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #e8eeff 100%);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Dark Mode Background */
[data-theme="dark"] body {
  background: linear-gradient(135deg, #111b47 0%, #3643b1 100%);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary) !important;
  letter-spacing: -0.025em;
}

.navbar-nav .nav-link:not(.icon-nav) {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  margin: 0 0.25rem;
}

.navbar-nav .nav-link:not(.icon-nav):hover,
.navbar-nav .nav-link:not(.icon-nav).active {
  color: var(--text-primary) !important;
  background-color: var(--bg-hover);
}

/* Navegação dinâmica - Estilos específicos */
.nav-link.icon-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  transition: all 0.3s ease;
  margin: 0 0.25rem;
}

.nav-link.icon-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(54, 67, 177, 0.2);
  background-color: rgba(54, 67, 177, 0.1) !important;
}

.nav-link.icon-nav.active {
  background: linear-gradient(135deg, var(--fea-azul-escuro) 0%, var(--fea-azul-claro) 100%) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(54, 67, 177, 0.4);
}

.nav-link.icon-nav.clicked {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Efeito de pulso para ícones ativos */
.nav-link.icon-nav.active::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--fea-azul-escuro), var(--fea-roxo-claro));
  z-index: -1;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

/* Responsividade para navegação dinâmica */
@media (max-width: 768px) {
  .nav-link.icon-nav {
    width: 35px;
    height: 35px;
    margin: 0 0.15rem;
  }
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

main.container {
  padding: 2rem 1rem;
}

/* Cards */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-secondary) !important;
}

.card-header {
  background: var(--bg-tertiary) !important;
  border-bottom: 1px solid var(--border-primary) !important;
  padding: 1.25rem 1.5rem !important;
  border-radius: 0 !important;
  word-wrap: break-word;
}

.card-title {
  color: var(--text-primary) !important;
  font-weight: 600;
  font-size: 1.125rem;
  margin: 0;
}

.card-body {
  padding: 1.5rem !important;
  word-wrap: break-word;
}

.card-footer {
  background: var(--bg-tertiary) !important;
  border-top: 1px solid var(--border-primary) !important;
  padding: 1.25rem 1.5rem !important;
  word-wrap: break-word;
}

/* Responsive Card Layout */
.row .col-md-6 .card,
.row .col-lg-4 .card,
.row .col-xl-3 .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card .mt-auto {
  margin-top: auto !important;
}

/* Buttons */
.btn {
  border-radius: var(--radius-md) !important;
  font-weight: 500;
  padding: 0.75rem 1.5rem !important;
  border: none !important;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%) !important;
  color: white !important;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--fea-azul-medio) 0%, var(--fea-roxo-medio) 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(54, 67, 177, 0.4);
}

.btn-success {
  background: var(--accent-secondary) !important;
  color: white !important;
}

.btn-success:hover {
  background: #059669 !important;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--accent-danger) !important;
  color: white !important;
}

.btn-danger:hover {
  background: #dc2626 !important;
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent !important;
  border: 2px solid var(--fea-azul-claro) !important;
  color: var(--fea-azul-claro) !important;
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--fea-azul-escuro) 0%, var(--fea-azul-claro) 100%) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 4px 15px rgba(54, 67, 177, 0.3);
}

/* Forms */
.form-control,
.form-select {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  padding: 0.75rem 1rem !important;
  transition: all var(--transition-fast);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-secondary) !important;
  border-color: var(--fea-roxo-claro) !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
}

.form-label {
  color: var(--text-primary) !important;
  font-weight: 500;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
}

/* Form responsive layout */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.5rem;
  margin-left: -0.5rem;
}

.form-row .col,
.form-row [class*="col-"] {
  padding-right: 0.5rem;
  padding-left: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
  width: 100%;
}

/* Tables */
.table {
  color: var(--text-primary) !important;
  margin-bottom: 0;
  width: 100%;
}

.table thead th {
  background: var(--bg-tertiary) !important;
  border-bottom: 1px solid var(--border-primary) !important;
  border-top: none !important;
  color: var(--text-primary) !important;
  font-weight: 600;
  padding: 1rem !important;
  white-space: nowrap;
}

.table tbody td {
  border-bottom: 1px solid var(--border-primary) !important;
  padding: 1rem !important;
  vertical-align: middle;
  word-wrap: break-word;
  max-width: 200px;
}

.table tbody tr:hover {
  background: var(--bg-hover) !important;
}

.table-responsive {
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
  margin-bottom: 0;
  min-width: 600px;
}

/* XML filename styling with forced two-line break */
.file-cell {
  max-width: 150px;
}

.file-cell .file-name {
  word-break: break-word;
  word-wrap: break-word;
  line-height: 1.4;
  display: block;
  max-width: 80px;
  min-height: 2.8em;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: normal;
}

/* Stats Grid Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--fea-azul-escuro) 0%, var(--fea-azul-claro) 100%);
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(54, 67, 177, 0.3);
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  line-height: 1;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Filter Section Styles */
.filter-section {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-header {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-primary);
}

.filter-title {
  display: flex;
  align-items: center;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.filter-content {
  padding: 1.5rem;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-label {
  display: flex;
  align-items: center;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}

/* Modern Table Styles */
.modern-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-header {
  background: var(--bg-secondary);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-title {
  display: flex;
  align-items: center;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.table-stats {
  display: flex;
  gap: 1rem;
}

.stat-badge {
  background: var(--accent-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modern-table-wrapper {
  overflow-x: auto;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.modern-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border-primary);
  white-space: nowrap;
}

.modern-table th.text-center {
  text-align: center;
}

.th-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.modern-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-primary);
  vertical-align: middle;
}

.table-row:hover {
  background: var(--bg-hover);
}

/* Table Cell Styles */
.identifier-cell {
  font-family: 'Courier New', monospace;
}

.identifier-code {
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--fea-azul-claro);
  border: 1px solid var(--fea-azul-claro);
  font-weight: 600;

  /* permite quebrar no meio */
  overflow-wrap: break-word;
  word-break: break-all; /* força quebra mesmo no meio */
  white-space: normal; /* garante que não fique tudo em uma linha só */
}

.process-cell {
  font-weight: 500;
}

.process-number {
  color: var(--text-primary);
}

.process-na {
  color: var(--text-muted);
  font-style: italic;
}

.client-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.client-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
}

.client-name {
  font-weight: 500;
  color: var(--text-primary);
}

.file-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.file-name {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.date-cell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.date-primary {
  font-weight: 500;
  color: var(--text-primary);
}

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

.status-cell {
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-pending {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.action-buttons .btn {
  padding: 0.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.action-buttons .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(54, 67, 177, 0.25);
}

/* Modern Pagination */
.pagination-container {
  padding: 1.5rem 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  display: flex;
  justify-content: center;
}

.modern-pagination {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
  align-items: center;
}

.page-item {
  display: flex;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: var(--bg-card);
  transition: all 0.2s ease;
  font-weight: 500;
  min-width: 44px;
  height: 44px;
}

.page-link:hover {
  background: var(--bg-hover);
  color: var(--fea-azul-claro);
  border-color: var(--fea-azul-claro);
  transform: translateY(-1px);
}

.page-item.active .page-link {
  background: linear-gradient(135deg, var(--fea-azul-escuro) 0%, var(--fea-azul-claro) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(54, 67, 177, 0.3);
}

.page-item.disabled .page-link {
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-color: var(--border-primary);
  cursor: not-allowed;
}

.page-item.disabled .page-link:hover {
  transform: none;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-color: var(--border-primary);
}

/* Alerts */
.alert {
  border: none !important;
  border-radius: var(--radius-md) !important;
  padding: 1rem 1.25rem !important;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1) !important;
  color: var(--accent-secondary) !important;
  border-left: 4px solid var(--accent-secondary) !important;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1) !important;
  color: var(--accent-danger) !important;
  border-left: 4px solid var(--accent-danger) !important;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1) !important;
  color: var(--accent-warning) !important;
  border-left: 4px solid var(--accent-warning) !important;
}

.alert-info {
  background: rgba(102, 126, 234, 0.1) !important;
  color: var(--fea-azul-claro) !important;
  border-left: 4px solid var(--fea-azul-claro) !important;
}

/* Progress */
.progress {
  background: var(--bg-tertiary) !important;
  border-radius: var(--radius-md) !important;
  height: 0.75rem;
  margin: 1rem 0;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) !important;
  transition: width var(--transition-normal);
}

/* List Groups */
.list-group {
  max-height: 400px;
  overflow-y: auto;
  border-radius: var(--radius-md);
}

.list-group-item {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  color: var(--text-primary) !important;
  padding: 1rem !important;
  border-left: 4px solid transparent !important;
  transition: all var(--transition-fast);
}

.list-group-item:hover {
  background: var(--bg-hover) !important;
}

.list-group-item-success {
  border-left-color: var(--accent-secondary) !important;
}

.list-group-item-danger {
  border-left-color: var(--accent-danger) !important;
}

.list-group-item-info {
  border-left-color: var(--accent-primary) !important;
}

/* Select2 Dark Theme */
.select2-container--bootstrap-5 .select2-dropdown {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--radius-md) !important;
}

.select2-container--bootstrap-5 .select2-results__option {
  color: var(--text-primary) !important;
  background: transparent !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background: var(--bg-hover) !important;
}

.select2-container--bootstrap-5 .select2-selection {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--radius-md) !important;
}

.select2-container--bootstrap-5 .select2-selection__rendered {
  color: var(--text-primary) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Enhanced Animations and Transitions */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.slide-in {
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from { 
        transform: translateX(-30px); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { 
        transform: scale(0.8); 
        opacity: 0; 
    }
    to { 
        transform: scale(1); 
        opacity: 1; 
    }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% { 
        transform: scale(0.3); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.05); 
    }
    70% { 
        transform: scale(0.9); 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

.slide-up {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Hover Animations */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(54, 67, 177, 0.4), 0 0 40px rgba(102, 126, 234, 0.2);
}

/* Loading Animation */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.5; 
    }
}

.loading-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { 
        transform: rotate(0deg); 
    }
    to { 
        transform: rotate(360deg); 
    }
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    animation: staggerIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(n+6) { animation-delay: 0.6s; }

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

/* Smooth Page Transitions */
.page-transition {
    animation: pageTransition 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.fade-enter {
  animation: fadeIn var(--transition-normal) ease-out;
}

.slide-enter {
  animation: slideIn var(--transition-normal) ease-out;
}

/* Form Styles */
.modern-form {
    max-width: none;
}

.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

/* Grid Layout for Configuration Form */
.config-grid-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  grid-template-rows: min-content auto auto;
  gap: 0;
  overflow: visible;
  height: calc(100vh - 200px);
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.config-basic-info {
  grid-column: 1;
  grid-row: 1;
  overflow: visible;
  height: fit-content;
  padding: 0 1rem;
}

.config-mapping {
  grid-column: 2;
  grid-row: 1 / 3;
  overflow: visible;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 1rem;
}

.config-rules {
  grid-column: 1;
  grid-row: 2;
  overflow: visible;
  height: 100%;
  padding: 0 1rem;
}

.config-actions {
  grid-column: 1 / 3;
  grid-row: 3;
  height: fit-content;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Compact form sections for grid layout */
.config-grid-container .form-section {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow: visible;
  height: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 100%;
}

/* Container principal ocupando toda a largura */
.content-container {
    width: 100%;
    margin: 0;
    padding: 0 1rem;
}


.config-grid-container .section-header {
  padding: 0 0 1rem 0;
  margin-bottom: 1rem;
  flex-shrink: 0;
  border-bottom: 2px solid var(--border-primary);
}

.config-grid-container .section-content {
  flex: 1;
  overflow: visible;
  padding: 0;
  min-height: 0;
}

/* Mapping container adjustments for grid */
.config-mapping .mapping-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.config-mapping .mapping-fields {
  flex: 1;
  overflow: visible;
}

/* Rules container adjustments for grid */
.config-rules .rules-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.config-rules .rules-list {
  flex: 1;
  overflow: visible;
}

/* Melhorar legibilidade dos campos */
.config-grid-container .form-control,
.config-grid-container .form-select {
  font-size: 14px;
  padding: 0.75rem;
  border: 2px solid var(--border-primary);
  border-radius: 6px;
  background-color: var(--bg-card);
  color: var(--text-primary);
  line-height: 1.5;
}

.config-grid-container .form-control:focus,
.config-grid-container .form-select:focus {
  border-color: var(--fea-roxo-claro);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.config-grid-container .form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 14px;
}

.config-grid-container .form-group {
  margin-bottom: 1.5rem;
}

/* Estilo do botão de ação */
.config-actions .btn {
  min-width: 200px;
  padding: 1rem 2rem;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(54, 67, 177, 0.3);
  transition: all 0.3s ease;
}

.config-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(54, 67, 177, 0.4);
}

.form-section:hover {
    border-color: var(--border-secondary);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.section-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--accent-primary);
    font-size: 1.25rem;
}

.section-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.form-label i {
    color: var(--accent-primary);
    font-size: 0.9rem;
}

/* Import Section */
.import-section {
    margin-bottom: 1.5rem;
}

.import-card {
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
}

.import-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.import-header i {
    font-size: 2rem;
    opacity: 0.9;
}

.import-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.import-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.file-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.file-input-wrapper input[type="file"] {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.file-input-wrapper input[type="file"]::file-selector-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-right: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-wrapper input[type="file"]::file-selector-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mapping Fields */
.mapping-container {
    margin-top: 1.5rem;
}

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

.mapping-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.mapping-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mapping-field {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.mapping-field:hover {
    border-color: var(--fea-azul-claro);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.15);
}

.mapping-field-content {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr auto;
    gap: 0.75rem;
    align-items: end;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.fixed-value-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    cursor: pointer;
}

.field-actions {
    display: flex;
    align-items: end;
}

/* Rules Container */
.rules-container {
    margin-top: 1.5rem;
}

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

.rules-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rule-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.rule-card:hover {
    border-color: var(--fea-azul-claro);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.rule-header {
    background: linear-gradient(135deg, var(--fea-azul-escuro) 0%, var(--fea-azul-claro) 100%);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.rule-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.rule-title input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 500;
    max-width: 300px;
}

.rule-title input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.rule-id {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.rule-content {
    padding: 1.25rem;
}

.rule-section {
    margin-bottom: 1.5rem;
}

.rule-section:last-child {
    margin-bottom: 0;
}

.section-title {
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-primary);
}

.section-title h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title h4 i {
    color: var(--accent-primary);
    font-size: 1rem;
}

.section-title p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.85rem;
}

/* Conditions */
.conditions-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.condition-item {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
}

.condition-content {
    display: grid;
    grid-template-columns: 1fr 150px 1fr auto;
    gap: 1rem;
    align-items: end;
}

/* Distribution Config */
.distribution-config {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Values Container */
.values-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.value-item {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
}

.value-content {
    display: grid;
    grid-template-columns: 1fr 120px auto;
    gap: 1rem;
    align-items: end;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-primary);
    margin-top: 1.5rem;
}

.form-actions .btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 200px;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    color: white;
    padding: 1.25rem 0;
    margin-bottom: 1.5rem;
    border-radius: 0 0 20px 20px;
}

.page-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}



.page-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title i {
    font-size: 2rem;
    opacity: 0.9;
}

.page-title h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.page-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 500;
}

.page-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.content-container {
    width: 100%;
    margin: 0;
    padding: 0 1rem;
}

/* Responsive Design */
/* Extra Large devices (large desktops, 1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  .content-container {
    width: 100%;
    margin: 0;
    padding: 0 2rem;
  }
}

/* Large devices (desktops, 1200px and up) */
@media (max-width: 1399px) and (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  
  .content-container {
    width: 100%;
    margin: 0;
    padding: 0 1.5rem;
  }
}

/* Medium-Large devices (large tablets, small desktops, 992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
  .mapping-field-content {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  
  .field-actions {
    grid-column: span 2;
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .content-container {
    width: 100%;
    margin: 0;
    padding: 0 1rem;
  }
  
  .page-header-content {
    padding: 0 1.5rem;
  }
}

/* Medium devices (tablets, 768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .nav-link.icon-nav {
    width: 38px;
    height: 38px;
  }
  
  .card {
    margin-bottom: 1.25rem;
  }
  
  .mapping-field-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .field-actions {
    grid-column: span 1;
    justify-content: center;
    margin-top: 1rem;
  }
  
  .page-header-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 0 1rem;
  }
  
  .page-title h1 {
    font-size: 1.75rem;
  }
}

/* Small devices (landscape phones, 576px to 767px) */
@media (max-width: 767px) and (min-width: 576px) {
  .container {
    padding: 0 1rem;
  }
  
  main.container {
    padding: 1rem;
  }
  
  .navbar-brand {
    font-size: 1.125rem;
  }
  
  .nav-link.icon-nav {
    width: 36px;
    height: 36px;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .btn:not(.btn-sm):not(.btn-lg) {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .page-header-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .page-title h1 {
    font-size: 1.5rem;
  }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
  .container {
    padding: 0 0.75rem;
  }
  
  main.container {
    padding: 1rem 0.75rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.375rem; }
  h3 { font-size: 1.125rem; }
  
  .mapping-field-content {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .field-actions {
    justify-content: center;
    margin-top: 0.75rem;
    grid-column: span 1;
  }
  
  .condition-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .value-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .distribution-config {
    grid-template-columns: 1fr;
  }
  
  .page-header-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .page-actions {
    justify-content: center;
  }
  
  .page-title h1 {
    font-size: 1.5rem;
  }
  
  .content-container {
    padding: 0 1rem;
  }
  
  .form-section {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .section-header {
    margin-bottom: 1rem;
  }
  
  .mapping-header,
  .rules-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .rule-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  /* Table Responsive Styles */
  .table-header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .table-stats {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .stat-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .modern-table th,
  .modern-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .client-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .client-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .action-buttons .btn {
    width: 32px;
    height: 32px;
  }
  
  /* Pagination Responsive */
  .pagination-container {
    padding: 1rem;
  }
  
  .modern-pagination {
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .page-link {
    padding: 0.5rem 0.75rem;
    min-width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }
  
  /* Grid Layout Responsive */
  .config-grid-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    max-height: none;
  }
  
  .config-basic-info {
    grid-column: 1;
    grid-row: 1;
    max-height: none;
  }
  
  .config-mapping {
    grid-column: 1;
    grid-row: 2;
    max-height: none;
  }
  
  .config-rules {
    grid-column: 1;
    grid-row: 3;
    max-height: none;
  }
  
  .config-actions {
    grid-column: 1;
    grid-row: 4;
  }
}

@media (max-width: 480px) {
  .navbar-brand {
    font-size: 1.125rem;
  }
  
  .card-body {
    padding: 1rem !important;
  }
  
  .card-header {
    padding: 1rem 1.25rem !important;
  }
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --border-primary: #555555;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Icon Navigation Styles */
.icon-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  position: relative;
}

.icon-nav:hover {
  background-color: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Removido estilos para aria-current="page" para evitar conflitos */

.icon-nav i {
  font-size: 1.1rem;
}

/* User Avatar Styles */
.user-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fea-azul-escuro), var(--fea-azul-claro));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.user-avatar-large {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fea-azul-escuro), var(--fea-azul-claro));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* User Menu Overlay */
.user-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.user-menu-overlay.show {
  display: flex;
}

.user-menu-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  min-width: 300px;
  max-width: 400px;
  position: relative;
  animation: slideIn 0.3s ease;
}

.user-menu-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.user-menu-header h5 {
  margin: 0.5rem 0;
  color: var(--text-primary);
}

.user-menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.user-menu-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(5px);
}

.user-menu-item.text-danger {
  color: var(--accent-danger);
}

.user-menu-item.text-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
}

.user-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.user-menu-close:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modal Z-Index Fix - Garantir que modais apareçam acima da navbar */
.modal {
  z-index: 1060 !important;
}

.modal-backdrop {
  z-index: 1055 !important;
}

.modal-dialog {
  z-index: 1061 !important;
}

/* Ajustar outros elementos para hierarquia correta */
.dropdown-menu {
  z-index: 1050 !important;
}

.navbar {
  z-index: 1030 !important;
}

.user-menu-overlay {
  z-index: 1040 !important;
}

/* Mobile Responsive - Navbar and Navigation */
@media (max-width: 767px) {
  .navbar {
    padding: 0.75rem 0;
  }
  
  .navbar .container {
    padding: 0 1rem;
  }
  
  .navbar-brand {
    font-size: 1rem;
  }
  
  .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
  }
  
  .nav-link.icon-nav {
    width: 34px;
    height: 34px;
    margin: 0 0.125rem;
  }
  
  .nav-link.icon-nav i {
    font-size: 0.95rem;
  }
  
  .user-menu-content {
    margin: 1rem;
    min-width: auto;
    width: calc(100% - 2rem);
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  /* Navbar collapse behavior for very small screens */
  .navbar-collapse {
    border-top: 1px solid var(--border-primary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }
  
  /* Cards responsive adjustments */
  .card {
    margin-bottom: 1rem;
  }
  
  .card-header {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .card-footer {
    padding: 1rem 1.25rem;
  }
  
  /* Container adjustments */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .content-container {
    padding: 1rem;
  }
  
  /* Tables responsive adjustments */
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }
  
  .table th {
    font-size: 0.85rem;
  }
  
  .table td {
    max-width: 150px;
  }
  
  /* Forms responsive adjustments */
  .form-control,
  .form-select {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
  }
  
  .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
  }
  
  .form-group {
    margin-bottom: 0.875rem;
  }
  
  /* Force form elements to stack */
  .form-row {
    flex-direction: column;
  }
  
  .form-row .col,
  .form-row [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 575px) {
  .navbar {
    padding: 0.5rem 0;
  }
  
  .navbar-brand {
    font-size: 0.95rem;
  }
  
  .nav-link.icon-nav {
    width: 32px;
    height: 32px;
    margin: 0 0.1rem;
  }
  
  .nav-link.icon-nav i {
    font-size: 0.9rem;
  }
  
  .navbar-nav {
    gap: 0.125rem;
  }
  
  /* Cards for extra small screens */
  .card-header {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .card-footer {
    padding: 0.875rem 1rem;
  }
  
  /* Container adjustments for extra small screens */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .content-container {
    padding: 0.75rem;
  }
  
  /* Force single column layout */
  .col-md-6,
  .col-lg-4,
  .col-xl-3 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Tables for extra small screens */
  .table th,
  .table td {
    padding: 0.5rem 0.375rem;
    font-size: 0.8rem;
  }
  
  .table th {
    font-size: 0.75rem;
  }
  
  .table td {
    max-width: 120px;
  }
  
  .table-responsive .table {
    min-width: 500px;
  }
  
  /* XML filename line break for small screens */
  .file-cell .file-name {
    word-break: break-all;
    line-height: 1.3;
    max-width: 100px;
  }
  
  /* Forms for extra small screens */
  .form-control,
  .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  
  .form-group {
    margin-bottom: 0.75rem;
  }
  
  /* Button adjustments for forms */
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .btn-group .btn {
    width: auto;
  }
}

/* Theme Toggle Button */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 0.5rem;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(54, 67, 177, 0.2);
  background: var(--bg-hover);
  border-color: var(--fea-azul-claro);
}

.theme-toggle i {
  font-size: 1.1rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--fea-roxo-claro);
}

[data-theme="dark"] .theme-toggle i {
  color: #ffd700;
}

/* Smooth transitions for theme switch */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Navbar dark mode adjustments */
[data-theme="dark"] .navbar {
  background: rgba(30, 39, 73, 0.95) !important;
  border-bottom-color: var(--border-primary);
}
