.dashboard-body {
  background:
    radial-gradient(circle at top left, rgba(196, 144, 106, 0.20), transparent 34%),
    radial-gradient(circle at bottom right, rgba(92, 48, 32, 0.12), transparent 38%),
    linear-gradient(135deg, var(--creme) 0%, var(--creme-escuro) 100%);
  color: var(--texto-escuro);
  min-height: 100vh;
  background-attachment: fixed;
  position: relative;
  padding-top: 78px;
  opacity: 0;
  animation: pageFadeIn 0.6s ease forwards;
}

body.page-hidden {
  opacity: 0;
  visibility: hidden;
}

@keyframes pageFadeIn { to { opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.admin-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 65px;
  z-index: 1100;
  background: rgba(245, 234, 224, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(92, 48, 32, 0.10);
  box-shadow: 0 4px 20px rgba(92, 48, 32, 0.08);
  padding: 8px 16px;
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr 42px;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.6s ease;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-right { justify-content: flex-end; }

.header-center {
  display: flex;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

.header-center h1 {
  margin: 0;
  color: var(--marrom);
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: clamp(18px, 4vw, 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.logo-link,
.header-logo-texto,
.footer-logo-texto,
.drawer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  text-decoration: none;
  min-width: 0;
}

.logo-tua {
  font-family: var(--fonte-script);
  color: var(--marrom);
  font-weight: 300;
  line-height: 1;
}

.logo-pele {
  font-family: var(--fonte-titulo);
  color: var(--marrom);
  font-weight: 900;
  line-height: 1;
  -webkit-text-stroke: 0.03em var(--marrom);
  letter-spacing: -0.04em;
}

.header-logo-texto .logo-tua { font-size: 2.1rem; }
.header-logo-texto .logo-pele { font-size: 1.5rem; }

.hamburger-btn {
  background: var(--creme-escuro);
  border: 1px solid rgba(92, 48, 32, 0.06);
  color: var(--marrom);
  font-size: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 6px rgba(92, 48, 32, 0.10);
}

.hamburger-btn:hover {
  background: var(--marrom);
  color: var(--creme);
  transform: translateY(-2px);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.45);
  backdrop-filter: blur(5px);
  z-index: 1450;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transicao-lenta);
}

.drawer-overlay.ativo {
  opacity: 1;
  visibility: visible;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  max-width: calc(100vw - 32px);
  height: 100vh;
  z-index: 1500;
  background: var(--creme-claro);
  box-shadow: var(--sombra-xl);
  padding: var(--space-12) var(--space-6);
  transition: left var(--transicao-lenta);
  border-right: 1px solid rgba(92, 48, 32, 0.12);
  overflow-y: auto;
}

.nav-drawer.aberto { left: 0; }
.drawer-brand { margin-bottom: var(--space-10); }
.drawer-brand .logo-tua { font-size: 2.5rem; }
.drawer-brand .logo-pele { font-size: 1.8rem; }

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.drawer-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-full);
  color: var(--marrom);
  font-family: var(--fonte-corpo);
  font-size: var(--texto-md);
  font-weight: 700;
  transition: all var(--transicao-normal);
  text-decoration: none;
}

.drawer-nav a:hover,
.drawer-nav a.active {
  background: var(--marrom);
  color: var(--creme);
  transform: translateX(4px);
}

.content-wrapper {
  min-height: calc(100vh - 180px);
  width: 100%;
  padding-bottom: 40px;
}

.dashboard-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.filters-section,
.kpis-section,
.projection-section,
.charts-section,
.tables-section,
.summary-section {
  animation: slideInUp 0.6s ease forwards;
  opacity: 0;
}
.kpis-section { animation-delay: .05s; }
.projection-section { animation-delay: .10s; }
.charts-section { animation-delay: .15s; }
.tables-section { animation-delay: .20s; }
.summary-section { animation-delay: .25s; }

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fonte-titulo);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--marrom);
  margin-bottom: 22px;
}

.filters-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(92, 48, 32, 0.10);
  box-shadow: var(--sombra-md);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.filter-group label {
  font-weight: 800;
  color: var(--marrom);
  font-size: 14px;
  white-space: nowrap;
}

.custom-select-wrapper {
  background: var(--creme-claro);
  border: 1px solid rgba(92, 48, 32, 0.14);
  color: var(--marrom);
  border-radius: 999px;
  padding: 10px 15px;
  cursor: pointer;
  min-width: 200px;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 4px rgba(92, 48, 32, 0.04);
}

.btn-refresh {
  background: linear-gradient(135deg, var(--marrom) 0%, var(--marrom-medio) 100%);
  border: none;
  color: var(--creme);
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 10px rgba(92, 48, 32, 0.18);
}

.btn-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(92, 48, 32, 0.24);
}

.period-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.45);
  backdrop-filter: blur(5px);
  z-index: 2000;
}

.period-modal {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(460px, 100%);
  background: var(--creme-claro);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  z-index: 2001;
  padding: 20px;
  box-shadow: 0 -18px 44px rgba(92, 48, 32, 0.22);
  animation: slideUp 0.3s ease-out;
}

.period-header {
  text-align: center;
  font-weight: 900;
  margin-bottom: 18px;
  color: var(--marrom);
  font-family: var(--fonte-titulo);
  font-size: 22px;
}

.period-options { display: grid; gap: 8px; }

.period-option {
  padding: 14px;
  border-radius: 14px;
  text-align: center;
  color: var(--marrom);
  background: var(--branco);
  cursor: pointer;
  font-weight: 800;
  transition: all .25s ease;
}
.period-option:hover,
.period-option.active {
  background: var(--marrom);
  color: var(--creme);
}

.kpis-section,
.projection-section,
.charts-section,
.tables-section,
.summary-section {
  margin-bottom: 50px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.kpi-card,
.projection-card,
.chart-container,
.tabs-container {
  background: rgba(255, 255, 255, 0.78);
  color: var(--texto-escuro);
  border-radius: 22px;
  box-shadow: var(--sombra-lg);
  border: 1px solid rgba(92, 48, 32, 0.10);
  overflow: hidden;
}

.kpi-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.kpi-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 34px rgba(92, 48, 32, 0.20);
}

.clickable-card { cursor: pointer; }

.kpi-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.kpi-label {
  font-size: 13px;
  font-weight: 900;
  color: var(--marrom);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-period {
  font-size: 12px;
  color: var(--texto-suave);
  font-weight: 600;
}

.kpi-value {
  font-size: clamp(27px, 5vw, 36px);
  font-weight: 900;
  color: var(--marrom);
  line-height: 1;
  margin-bottom: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-change {
  font-size: 14px;
  color: var(--texto-medio);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 34px;
  color: rgba(92, 48, 32, 0.12);
}

.goal-status-container {
  background: rgba(92, 48, 32, 0.07);
  padding: 8px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 13px;
  font-weight: 800;
  color: var(--marrom);
  display: block;
  border: 1px dashed rgba(92, 48, 32, 0.25);
  text-align: left;
}

.goal-status-container:hover { background: rgba(92, 48, 32, 0.12); }

.projection-card { padding: 30px; }

.projection-header {
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.projection-label {
  font-size: 15px;
  font-weight: 900;
  color: var(--marrom);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.volume-slider-container {
  position: relative;
  width: 100%;
  padding: 10px 0;
}

.volume-bar-track.volumetric {
  background: var(--creme-escuro);
  height: 50px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 8px 18px rgba(92,48,32,0.24), 0 2px 5px rgba(92,48,32,0.08);
  position: relative;
  overflow: hidden;
}

.volume-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--marrom), var(--marrom-claro));
}

.volumetric-gloss {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.12) 100%);
  pointer-events: none;
}

.volume-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 18px;
  color: var(--texto-escuro);
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  z-index: 2;
}

.volume-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--marrom);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 24px;
}

.chart-container {
  padding: 24px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.chart-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(92, 48, 32, 0.20);
}

.chart-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--marrom);
  margin-bottom: 20px;
  text-align: center;
  font-family: var(--fonte-corpo);
}

.chart-container canvas {
  max-height: 300px;
}

.chart-placeholder {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--texto-suave);
  font-weight: 800;
  background: rgba(92, 48, 32, 0.04);
  border-radius: 16px;
}

.tabs-container { overflow: hidden; }

.tabs-header {
  display: flex;
  border-bottom: 2px solid rgba(92, 48, 32, 0.10);
  background: rgba(92, 48, 32, 0.04);
}

.tab-btn {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--texto-medio);
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover { background: rgba(92, 48, 32, 0.08); }

.tab-btn.active {
  color: var(--marrom);
  border-bottom-color: var(--marrom);
  background: rgba(255, 255, 255, 0.36);
}

.table-content {
  display: none;
  padding: 24px;
}

.table-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table thead { background: rgba(92, 48, 32, 0.06); }

.data-table th {
  padding: 12px;
  text-align: left;
  font-weight: 900;
  color: var(--marrom);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid rgba(92, 48, 32, 0.10);
}

.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(92, 48, 32, 0.08);
  color: var(--texto-escuro);
  font-size: 14px;
}

.data-table tbody tr:hover { background: rgba(92, 48, 32, 0.04); }

.empty-state {
  text-align: center !important;
  color: var(--texto-suave) !important;
  padding: 38px 12px !important;
  font-style: italic;
  white-space: normal;
}

.table-action-btn {
  background: linear-gradient(135deg, var(--marrom) 0%, var(--marrom-medio) 100%);
  border: none;
  color: var(--creme);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.table-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(92,48,32,0.18);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}
.status-critical { color: var(--erro); background: rgba(192,57,43,.10); }
.status-warning { color: var(--aviso); background: rgba(192,154,43,.12); }
.status-ok { color: var(--sucesso); background: rgba(93,138,94,.12); }

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

.summary-card {
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 22px;
  border: 1px solid rgba(92, 48, 32, 0.10);
  box-shadow: var(--sombra-md);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-lg);
}

.summary-label {
  font-size: 12px;
  font-weight: 900;
  color: var(--texto-medio);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.summary-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--marrom);
  line-height: 1;
}

.summary-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 24px;
  color: rgba(92, 48, 32, 0.14);
}

.meta-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.52);
  backdrop-filter: blur(7px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
  padding: 20px;
}

.meta-content {
  background: linear-gradient(135deg, var(--marrom) 0%, var(--marrom-medio) 100%);
  padding: 34px;
  border-radius: 28px;
  text-align: center;
  max-width: 92vw;
  width: 420px;
  box-shadow: 0 18px 50px rgba(92, 48, 32, 0.32);
  border: 1px solid rgba(255,255,255,0.18);
}

.meta-content h2 {
  color: var(--creme);
  margin-bottom: 10px;
  font-family: var(--fonte-titulo);
  font-size: 30px;
}

.meta-content p {
  color: rgba(253, 248, 244, 0.86);
  margin-bottom: 20px;
  font-weight: 600;
}

.meta-content input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: none;
  text-align: center;
  font-size: 18px;
  margin-bottom: 18px;
  color: var(--marrom);
  font-weight: 800;
  outline: none;
}

.meta-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.meta-btn {
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: all .25s ease;
}

.meta-btn.primary {
  background: var(--creme);
  color: var(--marrom);
}

.meta-btn.secondary {
  background: rgba(255,255,255,0.12);
  color: var(--creme);
  border: 1px solid rgba(255,255,255,0.24);
}

.meta-btn:hover { transform: translateY(-2px); }

.dashboard-footer {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 28px 20px;
  color: var(--marrom);
  background: rgba(245, 234, 224, 0.82);
  border-top: 1px solid rgba(92, 48, 32, 0.10);
  margin-top: 40px;
}

.footer-logo-texto {
  justify-content: center;
  margin-bottom: 10px;
}
.footer-logo-texto .logo-tua { font-size: 2.1rem; }
.footer-logo-texto .logo-pele { font-size: 1.5rem; }
.dashboard-footer p { color: var(--texto-medio); }
.dev-link { color: var(--marrom); font-style: italic; }

#toast-container {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  z-index: 10000;
  display: grid;
  gap: 10px;
  width: min(92vw, 420px);
}

.toast {
  padding: 13px 18px;
  border-radius: 16px;
  color: var(--creme);
  font-weight: 800;
  text-align: center;
  box-shadow: var(--sombra-lg);
  background: var(--marrom);
  animation: toastIn .25s ease;
}
.toast.erro { background: var(--erro); }
.toast.sucesso { background: var(--sucesso); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .dashboard-body { padding-top: 72px; }
  .dashboard-container { padding: 18px 16px 0; }
  .filters-section {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 30px;
  }
  .filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .custom-select-wrapper,
  .btn-refresh { width: 100%; justify-content: center; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { padding: 18px; min-height: 178px; }
  .chart-container { padding: 16px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs-header {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs-header::-webkit-scrollbar { display: none; }
  .tab-btn { min-width: 190px; font-size: 12px; padding: 13px 10px; }
  .volume-center-text { font-size: 14px; }
  .volume-labels { flex-direction: column; gap: 4px; text-align: center; }
}

@media (max-width: 480px) {
  .admin-header { grid-template-columns: 78px 1fr 42px; padding: 8px 12px; }
  .header-logo-texto .logo-tua { font-size: 1.72rem; }
  .header-logo-texto .logo-pele { font-size: 1.22rem; }
  .header-center h1 { font-size: 18px; }
  .kpi-value { font-size: 24px; }
  .summary-grid { grid-template-columns: 1fr; }
  .data-table th,
  .data-table td { padding: 10px 8px; font-size: 12px; }
  .meta-actions { grid-template-columns: 1fr; }
}
