/* Dashboard customizado — compatível com Django Admin 6 + AdminLTE (escopo .adminlte-scope) */

/* Página index: largura total (padrão sitebuilder) */
body.dashboard #container {
  min-width: 0 !important;
  max-width: none !important;
}

body.dashboard .main,
body.dashboard #main {
  width: 100% !important;
  max-width: none !important;
}

body.dashboard #content {
  width: 100% !important;
  max-width: none !important;
  padding: 20px 24px !important;
  box-sizing: border-box;
  margin-right: 0 !important;
}

body.dashboard #content-main {
  float: none !important;
  width: 100% !important;
}

body.dashboard #content-related {
  display: none !important;
}

body.dashboard .colMS,
body.dashboard .colM {
  margin-right: 0 !important;
}

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

.dashboard-page-header h1 {
  margin: 0;
  white-space: nowrap;
}

/* Barra superior: título + filtros unificados */
.dashboard-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline-color, #ccc);
}

.dashboard-toolbar-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dashboard-toolbar-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}

.dashboard-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dashboard-field-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--body-quiet-color, #666);
  margin: 0;
}

.dashboard-field-label--empty {
  visibility: hidden;
  user-select: none;
}

.dashboard-control {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  background: var(--body-bg, #fff);
  color: var(--body-fg, #333);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25;
  box-shadow: none;
}

select.dashboard-control {
  min-width: 132px;
  padding-right: 28px;
  cursor: pointer;
}

.dashboard-control--year {
  width: 88px;
  min-width: 88px;
}

.dashboard-filter-submit {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid var(--primary, #417690);
  border-radius: 4px;
  background: var(--primary, #417690);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}

.dashboard-filter-submit:hover {
  filter: brightness(1.08);
}

.dashboard-layout {
  display: block;
  width: 100%;
}

.dashboard-main {
  min-width: 0;
  width: 100%;
}

/* Botões de ação rápida (grid customizado — ver também dashboard-adminlte-scope.css) */
.dashboard-action-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 72px;
  padding: 0.5rem;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--hairline-color, #ccc);
  border-radius: 8px;
  background: var(--body-bg, #fff);
  color: var(--body-fg, #333);
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.dashboard-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--body-fg) 8%, transparent);
  background: var(--selected-bg, #e4e4e4);
  color: var(--body-fg, #333);
}

.dashboard-action-btn i {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.dashboard-stat-card {
  padding: 1rem;
  border: 1px solid var(--hairline-color, #ccc);
  border-radius: 8px;
  background: var(--body-bg, #fff);
  text-align: center;
}

.dashboard-stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--body-quiet-color, #666);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dashboard-stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary, #417690);
}

.dashboard-chart {
  min-height: 280px;
  margin-bottom: 1.5rem;
}

.dashboard-alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  background: var(--selected-bg, #f0f7fa);
}

.admin-nav-search {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

#header .admin-nav-link {
  font-size: 0.8125rem;
}

@media (max-width: 768px) {
  body.dashboard #content {
    padding: 12px 16px !important;
  }

  .dashboard-toolbar {
    align-items: stretch;
  }

  .dashboard-toolbar-controls {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .dashboard-field {
    flex: 1 1 calc(50% - 6px);
  }

  .dashboard-field--action {
    flex: 1 1 100%;
  }

  .dashboard-field--action .dashboard-filter-submit {
    width: 100%;
  }
}
