/* =============================================
   SPIDER - Styles
   ============================================= */

/* =============================================
   CSS Variables
   ============================================= */
:root {
  /* Spider Green Theme */
  --primary: #00C853;
  --primary-dark: #00a844;
  --primary-light: #00E676;
  --secondary: #64748b;
  --success: #00C853;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Sidebar Dark */
  --sidebar-bg: #2d3748;
  --sidebar-darker: #1a202c;
  --sidebar-text: #a0aec0;

  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;

  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #94a3b8;

  --border-color: #e5e7eb;
  --border-radius: 10px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 25px rgba(0,0,0,0.08);

  --header-height: 60px;
  --sidebar-width: 260px;
}

/* =============================================
   Reset & Base
   ============================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =============================================
   Layout
   ============================================= */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.content {
  padding: 24px;
}

/* =============================================
   Sidebar
   ============================================= */
.sidebar-header {
  padding: 16px 20px;
  background: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-img {
  height: 40px;
  transform: scaleY(-1);
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--sidebar-bg);
}

.sidebar-empresa {
  font-size: 11px;
  color: var(--text-secondary);
}

.sidebar-nav {
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(0, 200, 83, 0.1);
  color: white;
  transform: translateX(4px);
}

.nav-item.active {
  background: rgba(0, 200, 83, 0.2);
  color: white;
  border-left: 3px solid var(--primary);
}

.nav-item-icon {
  width: 20px;
  margin-right: 12px;
  text-align: center;
  color: var(--primary);
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 8px 20px;
}

.nav-section-title {
  padding: 16px 20px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.5px;
}

/* =============================================
   Header
   ============================================= */
.header-title {
  font-size: 18px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* =============================================
   Cards
   ============================================= */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

/* =============================================
   KPI Cards
   ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
}

.kpi-value.positive { color: var(--success); }
.kpi-value.negative { color: var(--danger); }

.kpi-change {
  font-size: 12px;
  margin-top: 4px;
}

/* =============================================
   Buttons
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #00C853 0%, #00E676 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00a844 0%, #00C853 100%);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-success {
  background: var(--success);
  color: white;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.btn-icon {
  padding: 8px;
  min-width: 36px;
}

/* =============================================
   Forms
   ============================================= */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.1);
}

.form-control:disabled {
  background: var(--bg-primary);
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* =============================================
   Tables
   ============================================= */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
  background: #2d2d2d;
}

.table tr:hover {
  background: #f0fdf4;
}

.table .text-right {
  text-align: right;
}

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

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* =============================================
   Badges
   ============================================= */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.badge-secondary {
  background: rgba(100, 116, 139, 0.1);
  color: var(--secondary);
}

/* =============================================
   Modal
   ============================================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s;
}

.modal.show .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* =============================================
   Confirm Modal
   ============================================= */
.confirm-modal {
  padding: 32px;
  text-align: center;
  max-width: 400px;
}

.confirm-icon {
  font-size: 48px;
  color: var(--warning);
  margin-bottom: 16px;
}

.confirm-message {
  font-size: 16px;
  margin-bottom: 24px;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* =============================================
   Toast
   ============================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* =============================================
   Initial Page Load - Prevent Flash
   ============================================= */
/* Esconder todas as páginas até o JS inicializar */
body:not(.app-ready) #login-page,
body:not(.app-ready) #home-page,
body:not(.app-ready) #empresa-select-page,
body:not(.app-ready) #app-page {
  display: none !important;
}

/* Mostrar loading durante inicialização */
body:not(.app-ready) #loading-overlay {
  opacity: 1 !important;
  visibility: visible !important;
}

/* =============================================
   Loading Overlay
   ============================================= */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

#loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-message {
  margin-top: 16px;
  color: var(--text-secondary);
}

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

/* =============================================
   Login Page
   ============================================= */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 32px;
  color: var(--primary);
}

.login-logo p {
  color: var(--text-secondary);
  margin-top: 8px;
}

/* =============================================
   Dashboard Grid
   ============================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.dashboard-grid .full-width {
  grid-column: span 2;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid .full-width {
    grid-column: span 1;
  }
}

/* =============================================
   Filters Bar
   ============================================= */
.filters-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filters-bar .form-group {
  margin-bottom: 0;
}

/* =============================================
   Empty State
   ============================================= */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-message {
  font-size: 16px;
}

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

.tab {
  padding: 12px 24px;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .content {
    padding: 16px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    margin: 16px;
  }

  /* Esconder texto do botao em mobile */
  .btn-text-desktop {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  #user-name {
    display: none;
  }
}

/* =============================================
   Home Page
   ============================================= */
.home-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.home-header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeInDown 0.6s ease-out;
}

.home-logo {
  height: 100px;
  transform: scaleY(-1);
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0, 200, 83, 0.4));
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scaleY(-1) scale(1); }
  50% { transform: scaleY(-1) scale(1.05); }
}

.home-header h1 {
  font-size: 42px;
  color: white;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #00C853, #00E676);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-header p {
  color: #a0aec0;
  font-size: 18px;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  max-width: 800px;
  width: 100%;
}

.home-card {
  background: white;
  border-radius: 20px;
  padding: 40px 32px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out backwards;
  text-align: center;
}

.home-card:nth-child(1) { animation-delay: 0.2s; }
.home-card:nth-child(2) { animation-delay: 0.4s; }

.home-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.3s;
}

.home-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px rgba(0, 200, 83, 0.25);
  border-color: var(--primary);
}

.home-card:hover::before {
  transform: scaleX(1);
}

.home-card-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
  color: white;
  transition: transform 0.3s;
}

.home-card:hover .home-card-icon {
  transform: scale(1.1) rotate(5deg);
}

.home-card-icon.guia {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.home-card h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.home-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.home-card-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  transition: gap 0.3s;
}

.home-card:hover .home-card-action {
  gap: 12px;
}

.home-footer {
  margin-top: 48px;
  text-align: center;
  animation: fadeIn 0.6s ease-out 0.6s backwards;
  color: #a0aec0;
}

.home-footer strong {
  color: var(--primary);
}

.home-footer .btn {
  margin-top: 16px;
  background: transparent;
  color: #a0aec0;
  border: 1px solid #4a5568;
}

.home-footer .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Admin Section na Home */
.home-admin-section {
  margin-top: 32px;
  width: 100%;
  max-width: 800px;
}

.home-admin-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

.home-admin-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

.home-admin-card .admin-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.home-admin-card .admin-info {
  flex: 1;
}

.home-admin-card .admin-info h4 {
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.home-admin-card .admin-info p {
  color: #718096;
  font-size: 13px;
  margin: 0;
}

.home-admin-card .admin-arrow {
  color: #718096;
  transition: transform 0.3s;
}

.home-admin-card:hover .admin-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

/* =============================================
   Info Tooltip (icone de ajuda)
   ============================================= */
.page-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--info);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 12px;
  transition: all 0.2s;
  border: none;
}

.page-info-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* =============================================
   Pagina de Selecao de Empresa
   ============================================= */
.empresa-select-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.empresa-select-header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeInDown 0.6s ease-out;
}

.empresa-select-header img {
  height: 80px;
  transform: scaleY(-1);
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 6px rgba(0, 200, 83, 0.3));
}

.empresa-select-header h1 {
  font-size: 36px;
  color: white;
  margin-bottom: 8px;
}

.empresa-select-header p {
  color: #a0aec0;
  font-size: 16px;
}

.empresa-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 900px;
  width: 100%;
}

.empresa-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out backwards;
}

.empresa-card:nth-child(1) { animation-delay: 0.1s; }
.empresa-card:nth-child(2) { animation-delay: 0.2s; }
.empresa-card:nth-child(3) { animation-delay: 0.3s; }
.empresa-card:nth-child(4) { animation-delay: 0.4s; }

.empresa-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.3s;
}

.empresa-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 200, 83, 0.2);
  border-color: var(--primary);
}

.empresa-card:hover::before {
  transform: scaleX(1);
}

.empresa-card-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 28px;
  color: white;
}

.empresa-card-nome {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empresa-card-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empresa-card-permissao {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 12px;
  background: rgba(0, 200, 83, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.empresa-select-footer {
  margin-top: 48px;
  text-align: center;
  animation: fadeIn 0.6s ease-out 0.5s backwards;
}

.empresa-select-footer .btn {
  background: transparent;
  color: #a0aec0;
  border: 1px solid #4a5568;
}

.empresa-select-footer .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* =============================================
   Animacoes Globais
   ============================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Aplicar animacoes aos elementos */
.content {
  animation: fadeIn 0.4s ease-out;
}

.card {
  animation: fadeInUp 0.5s ease-out backwards;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card {
  animation: fadeInUp 0.5s ease-out backwards;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.15s; }
.kpi-card:nth-child(3) { animation-delay: 0.2s; }
.kpi-card:nth-child(4) { animation-delay: 0.25s; }

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.dashboard-grid .card:nth-child(1) { animation-delay: 0.3s; }
.dashboard-grid .card:nth-child(2) { animation-delay: 0.35s; }
.dashboard-grid .card:nth-child(3) { animation-delay: 0.4s; }
.dashboard-grid .card:nth-child(4) { animation-delay: 0.45s; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 16px;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--border-radius);
}

/* Transicoes suaves para navegacao */
.nav-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn:active {
  transform: scale(0.97);
}

/* Loading spinner melhorado */
.loading-spinner {
  border-width: 3px;
  animation: spin 0.8s linear infinite;
}

/* Indicador de carregamento inline */
.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.loading-inline::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Refresh indicator no header */
.refresh-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-indicator:hover {
  background: var(--primary);
  color: white;
}

.refresh-indicator.spinning i {
  animation: spin 1s linear infinite;
}

/* Status indicator */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.2);
  animation: pulse 2s infinite;
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
  .sidebar,
  .header,
  .btn,
  .filters-bar {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
