/**
 * Tema Festa — uso em todas as telas
 * Fundo creme, blocos de conteúdo em branco, cores por tipo de ação
 */

:root {
  --theme-bg: #fef7ed;
  --theme-radius: 14px;
  --theme-radius-sm: 10px;
  --theme-shadow: 0 1px 3px rgba(0,0,0,0.06);
  --theme-shadow-hover: 0 6px 20px rgba(0,0,0,0.12);
  --theme-font-size: 1.05rem;
  --theme-font-weight: 600;
  /* Cores por contexto */
  --theme-consulta: #ccfbf1;
  --theme-consulta-text: #0f766e;
  --theme-caixa: #fed7aa;
  --theme-caixa-text: #c2410c;
  --theme-venda: #bbf7d0;
  --theme-venda-text: #15803d;
  --theme-despesas: #fef08a;
  --theme-despesas-text: #a16207;
  --theme-alerta: #fecaca;
  --theme-alerta-text: #b91c1c;
  --theme-dash: #e0e7ff;
  --theme-dash-text: #3730a3;
  --theme-controle: #e2e8f0;
  --theme-controle-text: #334155;
  --theme-usuarios: #ede9fe;
  --theme-usuarios-text: #5b21b6;
  --theme-cartoes: #a5f3fc;
  --theme-cartoes-text: #0e7490;
}

/* Fundo padrão em todas as telas */
body {
  background: var(--theme-bg) !important;
  min-height: 100vh;
}

/* Navbar — tema festa */
nav.navbar {
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 1rem;
  min-height: 3.5rem;
  padding: 0.25rem 0;
}
nav.navbar .navbar-brand {
  min-height: 3rem;
}
nav.navbar .navbar-brand .navbar-item {
  padding: 0.5rem 0.75rem;
  background: transparent !important;
}
nav.navbar .navbar-brand .navbar-item:hover,
nav.navbar .navbar-brand .navbar-item.is-active {
  background: transparent !important;
}
nav.navbar .navbar-brand .navbar-item img {
  width: 140px !important;
  max-height: 3rem !important;
  height: auto !important;
  display: block;
}
nav.navbar .navbar-menu {
  padding: 0.5rem 0;
}
nav.navbar .navbar-item,
nav.navbar .navbar-link {
  color: #44403c;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
}
nav.navbar .navbar-item:hover,
nav.navbar .navbar-item.is-active {
  background: var(--theme-bg) !important;
  color: #1c1917;
}
nav.navbar .navbar-item.is-active {
  font-weight: 600;
}
nav.navbar .navbar-end .navbar-item {
  color: #78716c;
}
nav.navbar .navbar-end .navbar-item:hover {
  color: #1c1917;
}
nav.navbar .navbar-burger {
  color: #44403c;
  width: 3.25rem;
  height: 3.25rem;
}
nav.navbar .navbar-burger:hover {
  background: var(--theme-bg);
}
@media (min-width: 769px) {
  nav.navbar .navbar-start .navbar-item {
    margin: 0 0.15rem;
    border-radius: 8px;
  }
  nav.navbar .navbar-end .navbar-item {
    border-radius: 8px;
  }
}

/* Bloco de conteúdo: responsivo — mobile com pouca margem lateral; desktop usa max-width confortável */
.theme-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem 0.5rem;
  box-sizing: border-box;
}
@media (min-width: 576px) {
  .theme-content { padding: 1.25rem 1rem; max-width: 540px; }
}
@media (min-width: 768px) {
  .theme-content { padding: 2rem 1.5rem; max-width: 720px; }
}
@media (min-width: 992px) {
  .theme-content { padding: 2rem 2rem; max-width: 800px; }
}
.theme-content--wide { max-width: 100%; }
@media (min-width: 768px) {
  .theme-content--wide { max-width: 960px; padding: 2rem 1.5rem; }
}
@media (min-width: 992px) {
  .theme-content--wide { max-width: 1100px; padding: 2rem 2rem; }
}

.theme-card {
  background: #fff;
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow);
  padding: 1rem 1rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.15s ease;
}
@media (min-width: 576px) {
  .theme-card { padding: 1rem 1.25rem; }
}
.theme-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.theme-card:last-child { margin-bottom: 0; }
.theme-card-link { text-decoration: none; color: inherit; }
.theme-card-link:hover { box-shadow: var(--theme-shadow-hover); }

/* Cards coloridos (menu e listas) */
.theme-card--consulta { background: var(--theme-consulta); color: var(--theme-consulta-text); }
.theme-card--caixa { background: var(--theme-caixa); color: var(--theme-caixa-text); }
.theme-card--venda { background: var(--theme-venda); color: var(--theme-venda-text); }
.theme-card--despesas { background: var(--theme-despesas); color: var(--theme-despesas-text); }
.theme-card--alerta { background: var(--theme-alerta); color: var(--theme-alerta-text); }
.theme-card--dash { background: var(--theme-dash); color: var(--theme-dash-text); }
.theme-card--controle { background: var(--theme-controle); color: var(--theme-controle-text); }
.theme-card--usuarios { background: var(--theme-usuarios); color: var(--theme-usuarios-text); }

/* Título de página no tema */
.theme-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1rem 0;
}
@media (min-width: 768px) { .theme-title { font-size: 1.35rem; } }

/* Section do Bulma: fundo branco quando dentro do tema — responsivo */
body .section.theme-section {
  background: #fff;
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow);
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  margin-bottom: 1rem;
  max-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  body .section.theme-section { margin-left: auto; margin-right: auto; max-width: 800px; }
}
@media (min-width: 992px) {
  body .section.theme-section { max-width: 960px; }
}

/* Box do Bulma no tema */
body .box.theme-box {
  background: #fff;
  border-radius: var(--theme-radius-sm);
  box-shadow: var(--theme-shadow);
  border: none;
}

/* Botão primário alinhado ao tema */
.button.theme-btn-primary {
  background: var(--theme-caixa-text);
  color: #fff;
  border: none;
  border-radius: var(--theme-radius-sm);
  font-weight: var(--theme-font-weight);
  padding: 0.65rem 1.25rem;
  transition: opacity 0.15s, transform 0.1s;
}
.button.theme-btn-primary:hover { background: #a03a0a; color: #fff; }
.button.theme-btn-primary:active { transform: scale(0.98); }

/* Link voltar */
.theme-back {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: #78716c;
  text-decoration: none;
}
.theme-back:hover { color: #44403c; }

/* Menu em grid (Home, Controle) — responsivo */
.theme-menu-page {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem 0.5rem;
  box-sizing: border-box;
}
@media (min-width: 576px) {
  .theme-menu-page { padding: 1.5rem 1rem; max-width: 540px; }
}
@media (min-width: 768px) {
  .theme-menu-page { padding: 2rem 1.5rem; max-width: 640px; }
}
@media (min-width: 992px) {
  .theme-menu-page { padding: 2rem 2rem; max-width: 720px; }
}
.theme-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.theme-menu-grid li { margin: 0; }
.theme-menu-grid a {
  display: block;
  padding: 1.25rem 1rem;
  text-decoration: none;
  border-radius: var(--theme-radius);
  font-size: var(--theme-font-size);
  font-weight: var(--theme-font-weight);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.theme-menu-grid a:hover {
  transform: translateY(-3px);
  box-shadow: var(--theme-shadow-hover);
}
.theme-menu-grid a:active { transform: translateY(0); }
.theme-menu-item--consulta { background: var(--theme-consulta); color: var(--theme-consulta-text); }
.theme-menu-item--consulta:hover { background: #99f6e4; }
.theme-menu-item--caixa { background: var(--theme-caixa); color: var(--theme-caixa-text); }
.theme-menu-item--caixa:hover { background: #fdba74; }
.theme-menu-item--venda { background: var(--theme-venda); color: var(--theme-venda-text); }
.theme-menu-item--venda:hover { background: #86efac; }
.theme-menu-item--despesas { background: var(--theme-despesas); color: var(--theme-despesas-text); }
.theme-menu-item--despesas:hover { background: #fde047; }
.theme-menu-item--alerta { background: var(--theme-alerta); color: var(--theme-alerta-text); }
.theme-menu-item--alerta:hover { background: #fca5a5; }
.theme-menu-item--dash { background: var(--theme-dash); color: var(--theme-dash-text); }
.theme-menu-item--dash:hover { background: #c7d2fe; }
.theme-menu-item--controle { background: var(--theme-controle); color: var(--theme-controle-text); }
.theme-menu-item--controle:hover { background: #cbd5e1; }
.theme-menu-item--usuarios { background: var(--theme-usuarios); color: var(--theme-usuarios-text); }
.theme-menu-item--usuarios:hover { background: #ddd6fe; }
.theme-menu-item--formas { background: var(--theme-despesas); color: var(--theme-despesas-text); }
  .theme-menu-item--formas:hover { background: #fde047; }
  .theme-menu-item--barracas { background: var(--theme-venda); color: var(--theme-venda-text); }
  .theme-menu-item--barracas:hover { background: #86efac; }
  .theme-menu-item--cartoes { background: var(--theme-cartoes); color: var(--theme-cartoes-text); }
  .theme-menu-item--cartoes:hover { background: #67e8f9; }
@media (max-width: 520px) {
  .theme-menu-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .theme-menu-page { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* Dashboards — conteúdo e gráficos */
.dashboard-page { padding-bottom: 2rem; }
.dashboard-page .theme-card { overflow-x: auto; }
.dashboard-page .table-container { min-width: 0; }
.dashboard-chart-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0;
  min-height: 280px;
}
@media (min-width: 768px) {
  .dashboard-chart-wrap { min-height: 360px; }
}
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.dashboard-actions .theme-back { margin-top: 0; }
.dashboard-select .select select { border-radius: var(--theme-radius-sm); border: 1px solid #e2e8f0; padding: 0.5rem 2rem 0.5rem 0.75rem; }
