/* ===========================
   Admin Layout (New)
   =========================== */
.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #f3f4f6;
  position: fixed; /* Takes over the screen */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.admin-sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.sidebar-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.btn-voltar-sidebar {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  width: 100%;
  text-align: center;
  transition: all 0.2s;
}

.btn-voltar-sidebar:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Override existing admin-nav-btn for sidebar usage */
.admin-sidebar .admin-nav-btn {
  width: 100%;
  text-align: left;
  padding: 1rem 1.5rem;
  border: none;
  border-left: 4px solid transparent;
  background: transparent;
  color: var(--gray-600);
  font-size: 0.95rem;
  border-bottom: none; /* Reset old style */
  border-radius: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-sidebar .admin-nav-btn:hover {
  background: var(--gray-50);
  color: var(--primary);
  padding-left: 1.75rem; /* Slight slide effect */
}

.admin-sidebar .admin-nav-btn.active {
  background: #eff6ff;
  color: var(--primary);
  border-left-color: var(--primary);
  border-bottom-color: transparent; /* Reset old style */
  font-weight: 600;
}

.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
}

/* Dashboard Stats in Main Area */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 0; /* Wrapper handles gap */
}

.stat-card-new {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card-new:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.stat-card-new h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stat-card-new .value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-colors-indigo { color: var(--primary); }
.stat-colors-emerald { color: var(--success); }
.stat-colors-blue { color: var(--info); }

.stat-decoration {
  position: absolute;
  right: -10px;
  top: -10px;
  opacity: 0.1;
  font-size: 5rem;
  transform: rotate(15deg);
}

/* Adapt existing content to fit */
.admin-tab {
  animation: fadeIn 0.4s ease-out;
}

/* Print Styles */
@media print {
  body {
    background: white;
    height: auto;
    overflow: visible;
  }
  .admin-layout {
    position: relative;
    height: auto;
    width: 100%;
    overflow: visible;
    display: block;
    background: white;
  }
  .admin-sidebar {
    display: none !important;
  }
  .admin-main {
    padding: 0;
    margin: 0;
    overflow: visible;
    display: block;
  }
  
  /* Hide UI elements */
  .header-actions, 
  .filtros-panel,
  .dashboard-stats-grid,
  .btn,
  .admin-nav-btn {
    display: none !important;
  }

  /* Hide other tabs */
  .admin-tab {
    display: none !important;
  }
  .admin-tab.active {
    display: block !important;
  }

  /* Clean up card styles for print */
  .card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Ensure backgrounds print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Reset table container height */
  .table-container {
      max-height: none !important;
      overflow: visible !important;
  }
  
  /* Layout tweaks */
  .card-relatorio {
      page-break-inside: avoid;
  }
}
