/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width var(--dur) var(--ease);
}

.sidebar-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  height: var(--topbar-h);
}

.sidebar-logo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulseDot 3s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--accent-glow); }
  50%       { opacity: .5; box-shadow: none; }
}

.sidebar-logo-text { color: var(--text); }
.sidebar-logo-sep  { color: var(--text-muted); }

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 400;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
  border-radius: 10px;
  white-space: nowrap;
  user-select: none;
}

.nav-item:hover  { color: var(--text-dim); background: var(--bg3); }
.nav-item.active { color: var(--accent); background: var(--accent-dim); font-weight: 500; }

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ──── Sidebar bottom (theme) ──── */
.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   THEME SWITCHER
══════════════════════════════════════════════════════ */
.tema-switcher {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  display: flex;
  gap: 2px;
}

.tema-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 5px 0;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  line-height: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tema-btn:hover  { color: var(--text); background: var(--bg2); }
.tema-btn.active { background: var(--accent-dim); color: var(--accent); }

/* topbar tema-switcher: mobile only */
.topbar .tema-switcher { display: none; }

/* ══════════════════════════════════════════════════════
   MAIN + TOPBAR
══════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar-h);
  flex-shrink: 0;
}

.month-nav { display: flex; align-items: center; gap: 8px; }

.month-nav button {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
}
.month-nav button:hover { border-color: var(--accent); color: var(--accent); }

.month-label {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  min-width: 136px;
  text-align: center;
  letter-spacing: .02em;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ══════════════════════════════════════════════════════
   CONTENT + PAGE
══════════════════════════════════════════════════════ */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.page { display: none; }
.page.active {
  display: block;
  animation: fadeUp .22s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* ══════════════════════════════════════════════════════
   DASHBOARD CARDS GRID
══════════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

/* ══════════════════════════════════════════════════════
   CHART WRAPPERS
══════════════════════════════════════════════════════ */
.chart-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 22px;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.charts-row .chart-wrap {
  margin-bottom: 0;
  min-width: 0;
  overflow: hidden;
}

.charts-row .chart-wrap canvas {
  max-height: 200px;
}

/* ══════════════════════════════════════════════════════
   DASHBOARD TOTALIZADORES + BOXES
══════════════════════════════════════════════════════ */
.cards-totalizadores {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.cards-saldos {
  grid-template-columns: repeat(3, 1fr);
}

.cards-movimentacao {
  grid-template-columns: repeat(3, 1fr);
}

.dash-boxes-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
  align-items: stretch;
}

.dash-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dash-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dash-box-link {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--dur) var(--ease);
}
.dash-box-link:hover { color: var(--accent); }

.dash-faturas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dash-fatura-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  min-width: 0;
}

.dash-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

.dash-empty-link {
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 0;
  transition: opacity var(--dur) var(--ease);
}
.dash-empty-link:hover { opacity: .75; }

/* ══════════════════════════════════════════════════════
   BOTTOM NAV  (mobile only — shown via media query)
══════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 90;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-inner {
  display: flex;
  height: var(--bottom-nav-h);
}

.bottom-nav .nav-item {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  color: var(--text-muted);
}
.bottom-nav .nav-item svg { width: 22px; height: 22px; }
.bottom-nav .nav-item span.nav-label { display: inline; font-size: 10px; line-height: 1; }
.bottom-nav .nav-item:hover  { background: transparent; color: var(--text-dim); }
.bottom-nav .nav-item.active { color: var(--accent); background: transparent; }

/* ══════════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════════ */
#tela-login,
#tela-cadastro,
#tela-esqueci-senha,
#tela-redefinir-senha,
#tela-reenvio-confirmacao {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* modal-termos precisa ficar acima das telas de auth (z-index 200) */
#modal-termos { z-index: 250; }

.login-container {
  width: 100%;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 16px);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}

.login-logo {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -.02em;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Usuario info na topbar ── */
.usuario-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

#usuario-nome {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Botão flutuante de feedback ── */
#btn-feedback {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent2);
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 106, 255, 0.4);
  transition: transform .2s, box-shadow .2s;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#btn-feedback:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(124, 106, 255, 0.5);
}
