/* =====================================================================
   Plataforma Bella Renda e Viagens — estilos compartilhados
   Paleta e tipografia da identidade de marca
   (azul-marinho + rosa/marsala + Cormorant Garamond / DM Sans)
   ===================================================================== */

:root {
  --navy: #2E5A8C;
  --navy-soft: #6FA8D6;
  --rose: #96435A;
  --rose-dark: #7A3548;
  --rose-light: #F1E0E4;
  --marrom-claro: #C9AD92;
  --cream: #FBF6F4;
  --warm-white: #FFFFFF;
  --text: #2C3347;
  --muted: #8A93A8;
  --border: #E8DDE2;

  --primary: var(--rose);
  --primary-dark: var(--rose-dark);

  --cor-receita: #4f8a6d;
  --cor-despesa: #c0392b;
  --cor-essencial: var(--navy-soft);
  --cor-nao-essencial: var(--rose-dark);
  --cor-investimento: #4f8a6d;
  --cor-reserva: var(--navy);
}

html {
  font-size: 18px;
}

body {
  background: var(--cream);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  color: var(--text);
}

h1, h2, h3, h4, h5 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
}

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(22, 49, 92, .08);
  background: var(--warm-white);
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
  border-bottom: 1px solid var(--border);
  padding: .85rem 1.25rem;
}

.btn { border-radius: 8px; }
.btn-primario, .btn-primario:hover { color: #fff; }
.btn-primario { background: var(--rose); border-color: var(--rose); }
.btn-primario:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.btn-outline-rosa { color: var(--rose-dark); border-color: var(--rose-dark); background: transparent; }
.btn-outline-rosa:hover { background: var(--rose-dark); border-color: var(--rose-dark); color: #fff; }

.btn-acoes-linha {
  color: var(--rose-dark) !important;
  border: 1.5px solid var(--rose-dark) !important;
  background: var(--rose-light) !important;
  font-weight: 600;
  padding: .4rem .85rem !important;
  font-size: .9rem !important;
}
.btn-acoes-linha:hover { background: var(--rose-dark) !important; color: #fff !important; }

.dropdown-menu { border-radius: 10px; padding: .4rem; min-width: 210px; }
.dropdown-item {
  font-size: 1rem !important;
  padding: .65rem .9rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.dropdown-item i { font-size: 1.05rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--rose-light); color: var(--rose-dark); }
.dropdown-item.text-danger:hover, .dropdown-item.text-danger:focus { background: #f8d7da; color: var(--cor-despesa); }

.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--border);
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 .2rem rgba(207, 96, 138, .18);
}

.modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(22, 49, 92, .2);
  background: var(--warm-white);
}

.table th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  font-weight: 600;
}
.table td { font-size: .9rem; }

/* ---------------------------------------------------------------- */
/* Tela de login                                                      */
/* ---------------------------------------------------------------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--warm-white);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  padding: 2.5rem;
}

.login-card h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: .25rem;
  color: var(--navy);
}

.login-card p.subtitulo {
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--rose-dark);
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------- */
/* Menu de módulos                                                    */
/* ---------------------------------------------------------------- */
.modulos-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

.modulos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.modulos-header h1 {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}

.modulo-card {
  background: var(--warm-white);
  border-radius: 12px;
  padding: 1.75rem;
  height: 100%;
  text-decoration: none;
  color: var(--text);
  display: block;
  box-shadow: 0 1px 6px rgba(22, 49, 92, .08);
  transition: transform .15s ease, box-shadow .15s ease;
  border-left: 4px solid var(--rose);
}

.modulo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(22, 49, 92, .12);
  color: var(--text);
}

.modulo-card.indisponivel {
  opacity: .55;
  pointer-events: none;
  border-left-color: var(--border);
}

.modulo-card .icone {
  font-size: 2rem;
  color: var(--rose);
  margin-bottom: .75rem;
}

.modulo-card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: .35rem;
}

.modulo-card p {
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  color: var(--muted);
  margin: 0;
}

.badge-em-breve {
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem;
  background: var(--muted);
  color: #fff;
  border-radius: 999px;
  padding: .15rem .6rem;
  margin-left: .5rem;
}

/* ---------------------------------------------------------------- */
/* Layout com sidebar (módulo Financeiro)                             */
/* ---------------------------------------------------------------- */
.app-layout { display: flex; min-height: 100vh; }
.app-layout.carregando-permissoes { visibility: hidden; }

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-soft) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1000;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.35rem 1rem 1.1rem;
  color: var(--warm-white);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  text-decoration: none;
}
.sidebar-brand i { font-size: 1.4rem; flex-shrink: 0; color: var(--rose); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: .5rem 6px;
}
.sidebar-footer .sidebar-item { margin: 1px 0; width: 100%; }

.sidebar-section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, .4);
  padding: .9rem 1rem .2rem;
  font-weight: 500;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1rem;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  border-radius: 8px;
  margin: 1px 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  transition: background .15s, color .15s;
  user-select: none;
  border: none;
  background: none;
  width: calc(100% - 12px);
  text-align: left;
}
.sidebar-item:hover { background: rgba(255, 255, 255, .08); color: var(--warm-white); }
.sidebar-item.active { background: var(--rose); color: var(--warm-white); font-weight: 600; }
.sidebar-item i { font-size: 1.1rem; flex-shrink: 0; width: 20px; text-align: center; }

.main-content {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
}

.topbar {
  height: 52px;
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(22, 49, 92, .05);
}
.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--navy);
}

.view-tabs {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .85rem 1.5rem;
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
}
.view-tabs-row {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.view-tabs-row-secondary { opacity: .92; }
.view-tabs-row-secondary .view-tab { font-size: 1.05rem; padding: .55rem 1.3rem; }
.view-tabs-row-secondary .view-tab i { font-size: 1.15rem; }
.view-tab {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--navy);
  font-family: 'DM Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.view-tab i { font-size: 1.45rem; }
.view-tab:hover { background: rgba(207, 96, 138, .1); border-color: var(--rose); }
.view-tab.active { background: var(--navy); color: var(--warm-white); border-color: var(--navy); }

/* Cards de resumo com borda colorida à esquerda */
.card-resumo {
  border-left: 4px solid var(--rose);
  text-align: center;
}
.card-resumo.receita { border-left-color: var(--cor-receita); }
.card-resumo.despesa { border-left-color: var(--cor-despesa); }
.card-resumo .rotulo {
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: .25rem;
}
.card-resumo .valor {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--navy);
}

/* ---------------------------------------------------------------- */
/* Bottom nav (mobile only)                                           */
/* ---------------------------------------------------------------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 62px;
  background: var(--navy);
  z-index: 2000;
  border-top: 1px solid rgba(255,255,255,.12);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: rgba(255,255,255,.55);
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: .62rem;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.bottom-nav-item i { font-size: 1.35rem; line-height: 1; }
.bottom-nav-item.active { color: var(--rose); }
.mais-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 2001;
}
.mais-menu {
  display: none;
  position: fixed;
  bottom: 62px; left: 0; right: 0;
  background: var(--warm-white);
  border-radius: 16px 16px 0 0;
  z-index: 2002;
  padding: .5rem 0;
  box-shadow: 0 -4px 24px rgba(22,49,92,.15);
}
.mais-menu-item {
  display: flex; align-items: center; gap: .9rem;
  width: 100%; padding: .9rem 1.5rem;
  border: none; background: none;
  font-family: 'DM Sans', sans-serif; font-size: .95rem;
  color: var(--text); cursor: pointer; text-align: left;
}
.mais-menu-item i { font-size: 1.2rem; width: 22px; text-align: center; }
.mais-menu--open { display: block !important; }

@media (max-width: 767px) {
  .sidebar { display: none !important; }
  .main-content { margin-left: 0 !important; padding-bottom: 62px; }
  .bottom-nav { display: flex; }
  .topbar { padding: 0 1rem; }
  .view-tabs { padding: .6rem 1rem; gap: .3rem; }
  .view-tab { font-size: .78rem; padding: .35rem .75rem; }
}

/* Modo embutido — usado quando financeiro.html é aberto dentro de um iframe
   pela Mentoria (Módulo 2 · Despesas Domésticas), pra parecer uma atividade
   só, sem navegação de app duplicada por cima. */
body.embed-mode .sidebar { display: none !important; }
body.embed-mode .main-content { margin-left: 0 !important; }
body.embed-mode .topbar { display: none !important; }
body.embed-mode .bottom-nav { display: none !important; }

/* Tira as setinhas de incremento dos campos numéricos — só digitar o valor. */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}
