/* Estrutura do backoffice: barra superior, menu lateral recolhível e conteúdo em largura total. */

:root { --admin-topbar-h: 3rem; }

.admin-topbar { position: sticky; top: 0; z-index: 50; height: var(--admin-topbar-h); }
.admin-shell { min-height: calc(100vh - var(--admin-topbar-h)); }
.admin-mobile-header { position: sticky; top: var(--admin-topbar-h); z-index: 40; }

.admin-main {
  width: 100%;
  padding: 1.5rem 1rem;
}

@media (min-width: 768px) {
  .admin-main { padding-top: 2rem; padding-bottom: 2rem; }
}

@media (min-width: 1024px) {
  .admin-aside { top: var(--admin-topbar-h); width: 16rem; transition: width 150ms ease; }
  .admin-content { padding-left: 16rem; transition: padding-left 150ms ease; }

  html[data-sidebar="collapsed"] .admin-aside { width: 4rem; }
  html[data-sidebar="collapsed"] .admin-content { padding-left: 4rem; }
}

html[data-sidebar="collapsed"] .admin-aside .admin-label { display: none; }
html[data-sidebar="collapsed"] .admin-aside .admin-nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
html[data-sidebar="collapsed"] .admin-aside .admin-nav-group-title {
  height: 1px;
  margin: 0.5rem 0.75rem;
  padding: 0;
  overflow: hidden;
  font-size: 0;
  background: var(--border, rgba(128, 128, 128, 0.3));
}
html[data-sidebar="collapsed"] .admin-aside .admin-aside-header { padding: 0.75rem 0; text-align: center; }
html[data-sidebar="collapsed"] .admin-aside .admin-sidebar-chevron { transform: rotate(180deg); }
html[data-sidebar="collapsed"] .admin-aside .admin-aside-header { justify-content: center; }

/* Grade canônica de métricas (VoltUI): 4 colunas no desktop, 1 no mobile. */
.volt-stat-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

@media (max-width: 1023px) {
  .volt-stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .volt-stat-grid-4 { grid-template-columns: 1fr; }
}

/* Tabelas densas: cabeçalho fixo, zebra leve e linhas compactas. */
.admin-main .overflow-x-auto:has(> table) {
  max-height: 70vh;
  overflow-y: auto;
}

.admin-main table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card, var(--background));
  font-size: 0.75rem;
  white-space: nowrap;
}

.admin-main table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--muted, #888) 25%, transparent); }
.admin-main table tbody tr:hover { background: color-mix(in srgb, var(--muted, #888) 55%, transparent); }
.admin-main table tbody td { font-size: 0.8125rem; }

.admin-quick-filter {
  display: block;
  width: 100%;
  max-width: 20rem;
  min-height: 2.25rem;
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
  font-size: 0.8125rem;
}
