/* =====================================================================
   Meu Dinheiro — estilos globais
   Complementa o Bootstrap 5 (não substitui).
   ===================================================================== */
:root {
  --md-primary: #4f46e5;
  --md-primary-dark: #4338ca;
  --md-sidebar-bg: #1e293b;
  --md-sidebar-hover: #334155;
  --md-receita: #16a34a;
  --md-despesa: #dc2626;
  --md-bg: #f1f5f9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--md-bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1e293b;
}

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--md-sidebar-bg);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  transition: transform .25s ease;
  z-index: 1040;
}
.sidebar__brand {
  padding: 1.25rem 1.25rem 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar__brand i { color: #a5b4fc; }
.sidebar__nav { padding: .75rem 0; flex: 1; }
.sidebar__link {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.25rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: .92rem;
  border-left: 3px solid transparent;
}
.sidebar__link:hover { background: var(--md-sidebar-hover); color: #fff; }
.sidebar__link.active {
  background: var(--md-sidebar-hover);
  color: #fff;
  border-left-color: #818cf8;
}
.sidebar__link i { width: 20px; font-size: 1.05rem; text-align: center; }
.sidebar__section {
  padding: .75rem 1.25rem .25rem;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: #64748b;
}

.main-area { flex: 1; margin-left: 250px; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 1030;
}
.topbar__title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.topbar__user { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.topbar__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--md-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}

.page-content { padding: 1.5rem; flex: 1; }

/* ---------- Cards de indicadores ---------- */
.stat-card {
  background: #fff; border-radius: .75rem; padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); height: 100%;
  border: 1px solid #eef2f7;
}
.stat-card__label { font-size: .72rem; color: #64748b; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card__value { font-size: 1.15rem; font-weight: 700; margin-top: .2rem; white-space: nowrap; }
.stat-card .min-w-0 { min-width: 0; flex: 1; }
.stat-card__icon {
  width: 40px; height: 40px; border-radius: .6rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
@media (min-width: 1400px) { .stat-card__value { font-size: 1.3rem; } }
.text-receita { color: var(--md-receita) !important; }
.text-despesa { color: var(--md-despesa) !important; }
.bg-soft-primary { background: #eef2ff; color: var(--md-primary); }
.bg-soft-success { background: #dcfce7; color: var(--md-receita); }
.bg-soft-danger  { background: #fee2e2; color: var(--md-despesa); }
.bg-soft-warning { background: #fef3c7; color: #d97706; }
.bg-soft-info    { background: #e0f2fe; color: #0284c7; }

.card { border: 1px solid #eef2f7; border-radius: .75rem; }
.card-header { background: #fff; border-bottom: 1px solid #eef2f7; font-weight: 600; }

.btn-primary { background: var(--md-primary); border-color: var(--md-primary); }
.btn-primary:hover { background: var(--md-primary-dark); border-color: var(--md-primary-dark); }
.text-primary { color: var(--md-primary) !important; }

.badge-status { font-size: .72rem; padding: .35em .6em; }

table.table-financeiro td, table.table-financeiro th { vertical-align: middle; }

/* progress bars finas */
.progress { background: #e2e8f0; }

/* ---------- Login ---------- */
.login-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 1rem;
}
.login-card {
  background: #fff; border-radius: 1rem; padding: 2.25rem;
  width: 100%; max-width: 420px; box-shadow: 0 20px 40px rgba(0,0,0,.2);
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand i { font-size: 2.5rem; color: var(--md-primary); }
.login-brand h1 { font-size: 1.5rem; font-weight: 700; margin-top: .5rem; }

/* ---------- Toast ---------- */
.toast-container { z-index: 2000; }

/* ---------- Responsivo ---------- */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035;
}
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .sidebar-backdrop.show { display: block; }
}

.empty-state { text-align: center; padding: 2.5rem 1rem; color: #94a3b8; }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
