/* ==================== RESET & BASE ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Cores configuráveis do workspace (gradiente) */
  --color-primary: #667eea;
  --color-secondary: #764ba2;
  
  /* Usar cores do gradiente como primary */
  --primary: var(--color-primary);
  --primary-dark: var(--color-secondary);
  --bg-main: #f7f8fa;
  --bg-white: #ffffff;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 6px;
  --radius-lg: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.5;
}

/* ==================== TOPBAR ==================== */
.topbar {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.hamburger-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.3s;
  position: relative;
  width: 40px;
  height: 40px;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hamburger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger-btn.active .hamburger-icon span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: translateX(20px);
}

.hamburger-btn.active .hamburger-icon span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: white;
}

.topbar-logo:hover {
  opacity: 0.9;
}

.topbar-logo-img {
  max-height: 45px;
  max-width: 200px;
  object-fit: contain;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.15);
  font-size: 13px;
}

/* Theme Switch */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
  margin-right: 16px;
  cursor: pointer;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.3);
  transition: 0.3s;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.theme-switch input:checked + .theme-slider {
  background-color: rgba(0, 0, 0, 0.3);
}

.theme-slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: #ffffff;
  transition: 0.3s;
  border-radius: 50%;
}

.theme-switch input:checked + .theme-slider:before {
  transform: translateX(26px);
}

.sun-icon, .moon-icon {
  color: white;
  z-index: 1;
}

.theme-switch input:checked + .theme-slider .sun-icon {
  opacity: 0.5;
}

.theme-switch input:not(:checked) + .theme-slider .moon-icon {
  opacity: 0.5;
}

/* Dark Mode Styles */
body.dark-mode {
  --bg-main: #1a1a1a;
  --bg-white: #2d2d2d;
  --text-dark: #f5f5f5;
  --text-gray: #b3b3b3;
  --text-light: #8a8a8a;
  --border: #404040;
  --border-light: #353535;
}

body.dark-mode .modal {
  background: #2d2d2d;
  color: #f5f5f5;
}

body.dark-mode .modal-overlay {
  background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea {
  background: #1a1a1a;
  border-color: #404040;
  color: #f5f5f5;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-select:focus,
body.dark-mode .form-textarea:focus {
  background: #252525;
  border-color: var(--primary);
}

body.dark-mode .ag-theme-alpine {
  --ag-background-color: #2d2d2d;
  --ag-foreground-color: #f5f5f5;
  --ag-header-background-color: #1a1a1a;
  --ag-odd-row-background-color: #2d2d2d;
  --ag-row-hover-color: #353535;
}

body.dark-mode .sidebar-menu {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .login-box {
  background: #2d2d2d;
}

body.dark-mode .card {
  background: #2d2d2d;
  border-color: #404040;
}

.sidebar-logo, .topbar-logo-img {
  transition: opacity 0.3s ease;
}

.topbar-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.topbar-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==================== TOOLBAR ==================== */
.toolbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-dark);
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.toolbar-btn:hover {
  background: var(--bg-main);
  border-color: var(--text-gray);
}

.toolbar-btn.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.toolbar-btn.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.toolbar-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.toolbar-btn.primary:hover::before {
  opacity: 1;
}

.toolbar-btn.primary > * {
  position: relative;
  z-index: 1;
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
}

/* ==================== SIDEBAR MENU ==================== */
.sidebar-menu {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100vh;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
 
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transition: left 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-menu.open {
  left: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  padding: 24px;
  background: transparent;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: white;
}

.sidebar-logo {
  max-height: 55px;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: var(--bg-main);
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-menu-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: white;
}

.sidebar-menu-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-menu-item.active {
  background: #f0f9ff;
  border-left-color: var(--primary);
  color: var(--primary);
}

.sidebar-menu-item.danger {
  color: #dc2626;
}

.sidebar-menu-item.danger:hover {
  background: #fee2e2;
  border-left-color: #dc2626;
}

.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
 
}

.sidebar-submenu.open {
  max-height: 1000px;
}

.sidebar-submenu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 52px;
  color: rgba(255, 255, 255);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 13px;
}

.sidebar-submenu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding-left: 56px;
}

.sidebar-submenu-item svg {
  width: 16px;
  height: 16px;
}

.sidebar-expand-icon {
  margin-left: auto;
  transition: transform 0.3s;
}

.sidebar-menu-item.expanded .sidebar-expand-icon {
  transform: rotate(90deg);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 8px 20px;
}

/* ==================== CONTAINER ==================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.container-full {
  width: 100%;
  padding: 0;
}

/* ==================== CARDS GRID (tables.php) ==================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.card-description {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 16px;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.card-actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.card-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.card-btn:hover {
  background: var(--bg-main);
}

.card-btn.primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
 
  color: white;
  border-color: var(--primary);
}

.card-btn.primary:hover {
  background: var(--primary-dark);
}

.card-btn.danger {
  color: #dc2626;
  border-color: var(--border);
}

.card-btn.danger:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

/* ==================== TABLE WRAPPER ==================== */
.table-wrapper {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 20px;
}

#table-builder {
  min-height: 500px;
}

/* ==================== AG GRID CUSTOMIZATION ==================== */
.ag-theme-alpine {
  --ag-header-height: 44px;
  --ag-header-foreground-color: var(--text-gray);
  --ag-header-background-color: var(--bg-main);
  --ag-odd-row-background-color: var(--bg-white);
  --ag-row-hover-color: #fafbfc;
  --ag-selected-row-background-color: #f0f9ff;
  --ag-border-color: var(--border-light);
  --ag-font-size: 13px;
  --ag-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
  --ag-row-height: 42px;
  --ag-cell-horizontal-padding: 12px;
  --ag-row-border-width: 1px;
  --ag-cell-vertical-padding: 0px;
  line-height: 1;
}

/* Remover espaçamentos do body viewport */
.ag-theme-alpine .ag-body-viewport {
  line-height: 1 !important;
}

.ag-theme-alpine .ag-body-viewport * {
  box-sizing: border-box !important;
}

.ag-theme-alpine .ag-header-cell-label {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-gray);
}

.ag-theme-alpine .ag-cell {
  border-right: 1px solid var(--border-light);
  display: flex !important;
  align-items: center !important;
  overflow: hidden;
  padding: 0 12px !important;
}

.ag-theme-alpine .ag-cell-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.ag-theme-alpine .ag-cell-wrapper {
  width: 100%;
  overflow: hidden;
}

/* Link button in cells */
.cell-link-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #eff6ff;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  color: #2563eb;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  max-width: 100%;
  overflow: hidden;
}

.cell-link-btn:hover {
  background: #dbeafe;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.cell-link-btn svg {
  flex-shrink: 0;
}

.cell-link-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tooltip styling */
.ag-theme-alpine .ag-tooltip {
  background: var(--text-dark);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  max-width: 400px;
  word-wrap: break-word;
  box-shadow: var(--shadow-lg);
}

.ag-theme-alpine .ag-header-cell {
  border-right: 1px solid var(--border-light);
}

.ag-theme-alpine .ag-row {
  border-bottom: 1px solid var(--border-light) !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  position: relative !important;
  transform: none !important;
  height: 42px !important;
}

/* Resetar todos os transforms das linhas */
.ag-theme-alpine .ag-row[style*="transform"] {
  transform: translateY(0px) !important;
  position: relative !important;
  top: auto !important;
}

/* Fazer linhas ficarem uma embaixo da outra naturalmente */
.ag-theme-alpine .ag-center-cols-container,
.ag-theme-alpine .ag-pinned-left-cols-container,
.ag-theme-alpine .ag-pinned-right-cols-container {
  line-height: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

.ag-theme-alpine .ag-center-cols-container > *,
.ag-theme-alpine .ag-pinned-left-cols-container > *,
.ag-theme-alpine .ag-pinned-right-cols-container > * {
  margin: 0 !important;
  position: relative !important;
}

/* Forçar altura e alinhamento em todos os elementos internos */
.ag-theme-alpine .ag-cell-wrapper,
.ag-theme-alpine .ag-cell-value,
.ag-theme-alpine .ag-cell-wrapper > *,
.ag-theme-alpine .ag-cell-value > * {

  display: flex !important;
  align-items: center !important;
  line-height: normal !important;
}

/* Fix para alinhamento consistente das células */
.ag-theme-alpine .ag-cell-wrapper.ag-row-group {
  align-items: center;
}

.ag-theme-alpine .ag-paging-panel {
  border-top: 1px solid var(--border);
  background: var(--bg-main);
  padding: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.ag-theme-alpine .ag-paging-page-summary-panel {
  order: 1;
}

.ag-theme-alpine .ag-paging-row-summary-panel {
  order: 2;
}

.ag-theme-alpine .ag-paging-button {
  min-width: 32px;
  min-height: 32px;
  border-radius: 4px;
  transition: all 0.2s;
}

.ag-theme-alpine .ag-paging-button:hover:not(.ag-disabled) {
  background: var(--primary);
  color: white;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .ag-theme-alpine .ag-paging-panel {
    padding: 8px;
    font-size: 11px;
    gap: 6px;
    flex-direction: column;
  }
  
  .ag-theme-alpine .ag-paging-page-summary-panel {
    width: 100%;
    text-align: center;
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .ag-theme-alpine .ag-paging-button {
    min-width: 40px;
    min-height: 40px;
    font-size: 16px;
  }
  
  .ag-theme-alpine .ag-paging-row-summary-panel {
    order: 3;
    width: 100%;
    text-align: center;
  }
  
  /* Esconder texto "Page" e "of" */
  .ag-theme-alpine .ag-paging-page-summary-panel > span:first-child,
  .ag-theme-alpine .ag-paging-page-summary-panel > span:nth-child(3) {
    display: none;
  }
  
  /* Melhorar seletor de tamanho de página */
  .ag-theme-alpine .ag-paging-page-size {
    order: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .ag-theme-alpine .ag-paging-page-size select {
    min-height: 40px;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-white);
  }
}

@media (max-width: 480px) {
  .ag-theme-alpine .ag-paging-panel {
    padding: 6px;
    font-size: 10px;
  }
  
  .ag-theme-alpine .ag-paging-button {
    min-width: 36px;
    min-height: 36px;
  }
  
  .ag-theme-alpine .ag-paging-page-size select {
    min-height: 36px;
    font-size: 13px;
  }
}

.ag-theme-alpine .ag-root-wrapper {
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Touch scroll */
.ag-theme-alpine .ag-body-horizontal-scroll,
.ag-theme-alpine .ag-body-viewport {
  -webkit-overflow-scrolling: touch;
}

/* Melhor visualização em mobile */
@media (max-width: 768px) {
  .ag-theme-alpine .ag-header {
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  .ag-theme-alpine .ag-pinned-right-header,
  .ag-theme-alpine .ag-pinned-right-cols-container {
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
  }
}

/* Cell editing feedback */
.ag-theme-alpine .ag-cell-inline-editing {
  border: 2px solid var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(32, 193, 189, 0.1);
  background: var(--bg-white) !important;
}

/* Flash animation for saved cells */
.ag-theme-alpine .ag-cell-data-changed {
  background-color: #d1fae5 !important;
  transition: background-color 0.5s ease;
}

.ag-theme-alpine .ag-cell-data-changed-animation {
  background-color: #d1fae5;
}

/* Selected row styling */
.ag-theme-alpine .ag-row-selected {
  background-color: #f0f9ff !important;
}

.ag-theme-alpine .ag-row-selected:hover {
  background-color: #e0f2fe !important;
}

/* Checkbox styling */
.ag-theme-alpine .ag-checkbox-input-wrapper {
  font-size: 16px;
}

.ag-theme-alpine .ag-checkbox-input-wrapper.ag-checked::after {
  color: var(--primary);
}

/* Actions column header styling */
.ag-theme-alpine .ag-header-cell[col-id="_actions"] {
  background: var(--bg-main);
  border-left: 2px solid var(--border);
}

/* Action buttons styling */
.action-btn {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: var(--text-gray);
}

.action-btn:hover {
  transform: scale(1.1);
}

.action-btn.edit-btn:hover {
  background: #dbeafe;
  color: #2563eb;
}

.action-btn.delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.action-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  pointer-events: none;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
  .container {
    padding: 16px;
  }
  
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  /* Sidebar responsive */
  .sidebar-menu {
    width: 280px;
    left: -280px;
  }
  
  .sidebar-header {
    padding: 16px;
  }
  
  .sidebar-header h3 {
    font-size: 16px;
  }
  
  /* Topbar responsive */
  .topbar {
    padding: 0 12px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
  }


  
  .topbar-left,
  .topbar-right {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .topbar-logo {
    font-size: 20px;
  }
  
  .topbar-title {
    font-size: 14px;
  }
  
  .topbar-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .topbar-user {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  /* Toolbar responsive */
  .toolbar {
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .toolbar-left,
  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .toolbar-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  /* Container responsive */
  .container {
    padding: 12px;
  }
  
  /* Cards responsive */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .card {
    padding: 16px;
  }
  
  .card-title {
    font-size: 15px;
  }
  
  .card-description {
    font-size: 12px;
  }
  
  .card-actions {
    flex-direction: column;
    gap: 6px;
  }
  
  /* AG Grid responsive */
  .ag-theme-alpine {
    --ag-header-height: 40px;
    --ag-row-height: 38px;
    --ag-font-size: 12px;
    --ag-cell-horizontal-padding: 8px;
  }
  
  .table-wrapper {
    margin-top: 12px;
    border-radius: var(--radius);
  }
  
  #table-builder {
    height: calc(100vh - 180px) !important;
  }
  
  /* Action buttons responsive */
  .action-btn {
    padding: 4px;
  }
  
  .action-btn svg {
    width: 14px;
    height: 14px;
  }
  
  /* Special field execute button */
  .special-field-execute-btn {
    padding: 3px 5px;
  }
  
  .special-field-execute-btn svg {
    width: 12px;
    height: 12px;
  }
  
  /* Modals responsive */
  .modal {
    width: 95%;
    max-width: none;
    margin: 10px;
    max-height: calc(100vh - 20px);
  }
  
  .modal-header {
    padding: 16px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  
  /* Form elements responsive */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Evita zoom em iOS */
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  /* Filters responsive */
  #filters-wrapper {
    padding: 12px;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Column menu responsive */
  .column-menu {
    min-width: 160px;
    left: auto !important;
    right: 10px;
  }
  
  /* Login responsive */
  .login-box {
    padding: 24px;
  }
  
  .login-logo {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .topbar-logo {
    font-size: 18px;
  }
  
  .topbar-title {
    display: none; /* Esconde título em telas muito pequenas */
  }
  
  /* Sidebar full screen em mobile */
  .sidebar-menu {
    width: 100%;
    left: -100%;
  }
  
  .sidebar-menu.open {
    left: 0;
  }
  
  .toolbar-btn span {
    display: none; /* Mostra só ícones */
  }
  
  .toolbar-btn svg {
    margin: 0;
  }
  
  .ag-theme-alpine {
    --ag-font-size: 11px;
    --ag-cell-horizontal-padding: 6px;
  }
  
  .card-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .modal {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
  /* Dispositivos touch */
  .action-btn,
  .toolbar-btn,
  .card-btn,
  .btn {
    min-height: 44px; /* Apple HIG recommendation */
    min-width: 44px;
  }
  
  .topbar-btn {
    min-height: 40px;
  }
  
  .ag-theme-alpine {
    --ag-row-height: 44px;
  }
}

/* Landscape mode adjustments */
@media (max-width: 896px) and (orientation: landscape) {
  .topbar {
    height: 48px;
    min-height: 48px;
  }
  
  .toolbar {
    padding: 6px 12px;
  }
  
  #table-builder {
    height: calc(100vh - 120px) !important;
  }
}

/* Print styles */
@media print {
  .topbar,
  .toolbar,
  .action-btn,
  .special-field-execute-btn,
  .modal-overlay {
    display: none !important;
  }
  
  .table-wrapper {
    border: none;
    box-shadow: none;
  }
}

/* ==================== COLUMN MENU ==================== */
.custom-header-cell {
  position: relative;
}

.header-menu-btn:hover {
  background: var(--bg-main) !important;
  color: var(--text-dark) !important;
}

.header-menu-btn.active {
  background: var(--bg-main) !important;
  color: var(--primary) !important;
}

.column-menu {
  position: fixed;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  min-width: 180px;
  z-index: 10000;
  animation: fadeIn 0.15s ease-out;
}

.column-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dark);
  text-align: left;
  transition: all 0.15s;
}

.column-menu-item:hover {
  background: var(--bg-main);
}

.column-menu-item.delete {
  color: #dc2626;
}

.column-menu-item.delete:hover {
  background: #fee2e2;
}

.column-menu-item svg {
  flex-shrink: 0;
}

/* ==================== JSON PARSER CHIPS ==================== */
.json-chips-draggable {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-main);
  border-radius: var(--radius);
  min-height: 100px;
  max-height: 400px;
  overflow-y: auto;
}

.json-chip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: move;
  transition: all 0.2s;
}

.json-chip-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.json-chip-item.dragging {
  opacity: 0.5;
}

.json-chip-input {
  flex: 1;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}

.chip-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-gray);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.chip-remove-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.json-edit-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  color: var(--text-gray);
  flex-shrink: 0;
}

.json-edit-btn:hover {
  background: #f3f4f6;
  border-color: var(--text-gray);
  color: var(--text-dark);
  transform: scale(1.05);
}

.json-edit-btn svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* ==================== HELP BUTTON & INSTRUCTIONS POPOVER ==================== */
.help-btn {
  background: transparent;
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--primary);
  transition: all 0.2s;
  flex-shrink: 0;
}

.help-btn:hover {
  background: #eff6ff;
  border-color: var(--primary);
  transform: scale(1.1);
}

.help-btn svg {
  width: 16px;
  height: 16px;
}

.instructions-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
}

.instructions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-main);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.instructions-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.instructions-header button {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-gray);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.instructions-header button:hover {
  background: var(--bg-white);
  color: var(--text-dark);
}

.instructions-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
}

.instructions-content::-webkit-scrollbar {
  width: 6px;
}

.instructions-content::-webkit-scrollbar-track {
  background: var(--bg-main);
}

.instructions-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Estilo do conteúdo HTML das instruções */
.instructions-content h1,
.instructions-content h2,
.instructions-content h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.instructions-content p {
  margin-bottom: 12px;
}

.instructions-content ul,
.instructions-content ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.instructions-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.instructions-content pre {
  background: #1f2937;
  color: #10b981;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.instructions-content blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 12px;
  margin: 12px 0;
  color: var(--text-gray);
}

.instructions-content a {
  color: var(--primary);
  text-decoration: none;
}

.instructions-content a:hover {
  text-decoration: underline;
}

/* Responsive popover */
@media (max-width: 768px) {
  .instructions-popover {
    width: 95%;
    max-height: 90vh;
  }
  
  .instructions-content {
    padding: 16px;
    font-size: 13px;
  }
}

/* ==================== TAG CONFIGURATION CARDS ==================== */
.tag-config-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.tag-config-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.tag-config-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.tag-config-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tag-option-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.tag-option-checkbox:hover {
  background: var(--bg-main);
  border-color: var(--primary);
}

.tag-option-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.option-content {
  flex: 1;
}

.option-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--text-dark);
}

.option-content p {
  margin: 0;
  font-size: 12px;
  color: var(--text-gray);
  line-height: 1.5;
}

.predefined-options-group {
  margin-top: 12px;
  margin-left: 32px;
  padding: 12px;
  background: var(--bg-main);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

/* ==================== SPECIAL FIELD EXECUTE BUTTON ==================== */
.special-field-execute-icon {
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.6));
  position: relative;
}

.special-field-execute-icon:hover {
  transform: scale(1.2) rotate(12deg);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.9)) 
          drop-shadow(0 0 16px rgba(16, 185, 129, 0.6))
          drop-shadow(0 0 24px rgba(16, 185, 129, 0.4));
  animation: pulse-glow 1.5s ease-in-out infinite;
}

.special-field-execute-icon:active {
  transform: scale(0.95);
}

@keyframes pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.9)) 
            drop-shadow(0 0 16px rgba(16, 185, 129, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 1)) 
            drop-shadow(0 0 24px rgba(16, 185, 129, 0.8))
            drop-shadow(0 0 36px rgba(16, 185, 129, 0.6));
  }
}

/* Spinner para quando está executando */
.special-field-execute-icon.executing {
  animation: spin-pulse 1s linear infinite;
}

@keyframes spin-pulse {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Row hover effect for actions */
.ag-theme-alpine .ag-row {
  position: relative;
}

.ag-theme-alpine .ag-row:hover {
  background-color: #0b1d2ff0;
  color:white!important;
}

.ag-theme-alpine .ag-row:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  z-index: 1;
}

/* Smooth transitions */
.ag-theme-alpine .ag-cell,
.ag-theme-alpine .ag-header-cell {
  transition: background-color 0.2s ease;
}

/* Modern scrollbar */
.ag-theme-alpine ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.ag-theme-alpine ::-webkit-scrollbar-track {
  background: var(--bg-main);
}

.ag-theme-alpine ::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.ag-theme-alpine ::-webkit-scrollbar-thumb:hover {
  background: var(--text-gray);
}

/* Loading overlay */
.ag-theme-alpine .ag-overlay-loading-wrapper {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

/* Context menu styling */
.ag-theme-alpine .ag-menu {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* Filter panel styling */
.ag-theme-alpine .ag-filter {
  background: var(--bg-white);
  border-radius: var(--radius);
}

.ag-theme-alpine .ag-filter-apply-panel {
  padding: 8px;
}

.ag-theme-alpine .ag-standard-button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.ag-theme-alpine .ag-standard-button:hover {
  background: var(--primary-dark);
}

/* Pills para select fields */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pill.green { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; box-shadow: 0 2px 4px rgba(6, 95, 70, 0.1); }
.pill.blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; box-shadow: 0 2px 4px rgba(30, 64, 175, 0.1); }
.pill.purple { background: linear-gradient(135deg, #e9d5ff, #d8b4fe); color: #6b21a8; box-shadow: 0 2px 4px rgba(107, 33, 168, 0.1); }
.pill.yellow { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; box-shadow: 0 2px 4px rgba(146, 64, 14, 0.1); }
.pill.orange { background: linear-gradient(135deg, #fed7aa, #fdba74); color: #9a3412; box-shadow: 0 2px 4px rgba(154, 52, 18, 0.1); }
.pill.red { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; box-shadow: 0 2px 4px rgba(153, 27, 27, 0.1); }
.pill.gray { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); color: #4b5563; box-shadow: 0 2px 4px rgba(75, 85, 99, 0.1); }

/* ==================== FILTERS ==================== */
#filters-wrapper {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 20px;
  display: none;
}

#filters-wrapper.active {
  display: block;
}

.filters-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.filter-item label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-gray);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filter-item input,
.filter-item select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  transition: all 0.2s;
}

.filter-item input:focus,
.filter-item select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(32, 193, 189, 0.1);
}

.filters-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ==================== MODAL ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.2s ease-out;
}

/* Scroll suave no modal */
.modal::-webkit-scrollbar {
  width: 6px;
}

.modal::-webkit-scrollbar-track {
  background: var(--bg-main);
}

.modal::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.modal::-webkit-scrollbar-thumb:hover {
  background: var(--text-gray);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: white;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.2s;
  opacity: 0.9;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ==================== FORM ==================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: " *";
  color: #dc2626;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(32, 193, 189, 0.1);
}

.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-checkbox label {
  font-size: 14px;
  color: var(--text-dark);
  cursor: pointer;
}

/* ==================== BUTTONS ==================== */
.btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-dark);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  justify-content: center;
}

.btn:hover {
  background: var(--bg-main);
  border-color: var(--text-gray);
}

.btn.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.btn.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.btn.primary:hover::before {
  opacity: 1;
}

.btn.primary > * {
  position: relative;
  z-index: 1;
}

.btn.secondary {
  background: transparent;
  border-color: var(--border);
}

.btn.danger {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.btn.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  padding: 20px;
}

.login-box {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-gray);
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
}

.login-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.login-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.login-form {
  display: none;
}

.login-form.active {
  display: block;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-light);
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
