/* -------------- RESET --------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* -------------------- VARIÁVEIS GLOBAIS ------------------ */
:root {
    --cream:        #faf6f0;
    --sand:         #f0e8d8;
    --terracotta:   #c9714a;
    --terra-dark:   #a85a35;
    --forest:       #2d4a3e;
    --forest-light: #3d6254;
    --text:         #1e2a24;
    --muted:        #7a8c84;
    --white:        #ffffff;
    --error:        #d94f3d;
}

/* -------------------- BODY ----------------- */
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* -------------- PAINEL ESQUERDO ----------- */
.panel-left {
    width: 35%;
    background: var(--forest);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    overflow: hidden;
}

/* -------------- PAINEL DIREITO ------------ */
.panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
}

/* -------------- RESPONSIVO ------------ */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow: auto;
    }

    .panel-left {
        width: 100%;
        padding: 2rem;
    }

    .panel-right {
        padding: 2rem 1.5rem;
    }
}

/* ------------- MARCA ------------- */
.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: var(--terracotta);
    border-radius: 12px;
    display: flex;
    align-items: center;
    font-size: 1.99rem;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--white);
}

.onboarding-body .brand-name {
  color: var(--forest);
}

/* ------------ HERO (título e subtítulo) ------------ */
.panel-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.panel-hero h1 em {
    font-style: italic;
    color: #e8a882;
}

.panel-hero p {
    color: rgba(255, 255, 255, .65);
    font-size: .95rem;
    line-height: 1.7;
    max-width: 320px;
}

/* ----------------- CARDS DE ESTATÍSTICAS ------------- */
.stats {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.stat-card {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    padding: .9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 1.4rem;
    min-width: 36px;
    text-align: center;
}

.stat-label {
    font-size: .75rem;
    color: rgba(255, 255, 255, .5);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stat-value {
    font-size: 1rem;
    color: var(--white);
    font-weight: 500;
    margin-top: .15rem;
}

/* ------------- CARD DO FORMULÁRIO ------------ */
.form-card {
    width: 100%;
    max-width: 400px;
}

.form-header {
    margin-bottom: 2.5rem;
}

.form-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text);
    margin-bottom: .4rem;
}

.form-header p {
    color: var(--muted);
    font-size: .9rem;
}

/* ------------ CAMPOS ------------- */
.filed {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    color: var(--forest);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .5rem;
}

.field input {
    width: 100%;
    padding: .85rem 1rem;
    border: 1.5px solid #ddd6c8;
    border-radius: 12px;
    background: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus {
    border-color: var(--terracotta);
    box-shadow: 0 0 0 3px rgba(201, 113, 74, .12);
}

/* -------------- LINK ESQUECEU A SENHA ----------- */
.forgot {
    text-align: right;
    margin-top: .4rem;
}

.forgot a {
    font-size: .8rem;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}

.forgot a:hover {
    color: var(--terracotta);
}

/* ---------------- MENSAGEM DE ERRO ------------ */
.error-msg {
    background: #fdf0ee;
    border: 1px solid #f5c4bb;
    color: var(--error);
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .85rem;
    margin-bottom: 1.25rem;
    display: none;
}

.error-msg.show {
    display: block;
}

/* -------------- BOTÃO ----------- */
.btn-primary {
    width: 100%;
    padding: .95rem;
    background: var(--forest);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    margin-top: .5rem;
}

#btnLogin:hover {
    background: var(--forest-light);
    box-shadow: 0 6px 20px rgba(45, 74, 62, .25);
}

/* ----------------- LINK DE CADASTRO ------------- */
.register-link {
    text-align: center;
    font-size: .85rem;
    color: var(--muted);
    margin-top: 1.5rem;
}

.register-link a {
    color: var(--terracotta);
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
}

.register-link a:hover {
    color: var(--terra-dark);
}

/* ---------------- PÁGINA DE CADASTRO ---------------- */

/* painel direito com scroll se necessário */
.panel-right {
    overflow-y: auto;
}

/* ----------------- REGRAS DE SENHA ------------ */
.password-rules {
  list-style: none;
  margin-top: .6rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.password-rules li {
  font-size: .78rem;
  color: var(--muted);
  padding-left: 1.2rem;
  position: relative;
}

.password-rules li::before {
  content: '✗';
  position: absolute;
  left: 0;
  color: var(--error);
}

.password-rules li.valid {
  color: var(--forest);
}

.password-rules li.valid::before {
  content: '✓';
  color: var(--forest);
}

/* ====================== ONBOARDING ==================== */

/* ----------------- BODY ----------- */
.onboarding-body {
  display: block;
  overflow: auto;
  background: var(--cream);
}

/* ----------------- WRAPPER ----------- */
.onboarding-wrapper {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ----------------- CABEÇALHO ----------- */
.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* ----------------- BARRA DE PROGRESSO ------------ */
.progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--sand);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--terracotta);
  border-radius: 99px;
  transition: width .4s ease;
  width: 25%;
}

.progress-label {
  font-size: .75rem;
  color: var(--muted);
}

/* ----------------- CARD DO PASSO ---------------- */
.onboarding-card {
  background: var(--white);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(45, 74, 62, .08);
  flex: 1;
}

/* ----------------- CABEÇALHO DO PASSO --------------- */
.step-header {
  margin-bottom: 2rem;
}

.step-header.centered {
  text-align: center;
}

.step-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: .75rem;
}

.step-icon.big {
  font-size: 3.5rem;
}

.step-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: .4rem;
}

.step-header p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}

/* ---------- OPÇÕES (uma pessoa / mais de uma) ----------- */
.option-group {
  display: flex;
  gap: .75rem;
  margin-top: .5rem;
  margin-bottom: 1.25rem;
}

.option-btn {
  flex: 1;
  padding: .75rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 12px;
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}

.option-btn.active {
  border-color: var(--terracotta);
  background: #fdf3ee;
  color: var(--terracotta);
  font-weight: 500;
}

/* ----------------- RENDA MÚLTIPLA ----------- */
.income-item {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: .75rem;
  margin-top: .25rem;
}

.income-item input {
  flex: 1;
  padding: .75rem 1rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

.income-item input:focus {
  border-color: var(--terracotta);
}

.income-item .income-percent {
  font-size: .85rem;
  color: var(--forest);
  font-weight: 500;
  min-width: 48px;
  text-align: right;
}

.income-item .btn-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  transition: color .2s;
}

.income-item .btn-remove:hover {
  color: var(--error);
}

.income-total {
  margin-top: 1rem;
  padding: .9rem 1.25rem;
  background: #f0f6f3;
  border-radius: 12px;
  font-size: .95rem;
  color: var(--forest);
  font-weight: 500;
}

/* ----------------- BOTÃO SECUNDÁRIO ----------- */
.btn-secondary {
  background: none;
  border: 1.5px solid var(--forest);
  color: var(--forest);
  padding: .65rem 1.25rem;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  margin-top: 1rem;
}

.btn-secondary:hover {
  background: var(--forest);
  color: var(--white);
}

/* ----------------- BOTÃO GHOST (voltar) ----------- */
.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  cursor: pointer;
  transition: color .2s;
  padding: .65rem 0;
}

.btn-ghost:hover {
  color: var(--text);
}

/* ----------------- CATEGORIAS ----------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.category-chip {
  padding: .65rem 1rem;
  border-radius: 12px;
  border: 1.5px solid #ddd6c8;
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
  height: 42px;
}

.category-chip.selected {
  border-color: var(--terracotta);
  background: #fdf3ee;
  color: var(--terracotta);
  font-weight: 500;
}

/* ----------------- CATEGORIA PERSONALIZADA ----------- */
.custom-category-inputs {
  display: flex;
  gap: .75rem;
  align-items: stretch;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.custom-category-inputs input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: .75rem 1rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}

.custom-category-inputs input[type="text"]:focus {
  border-color: var(--terracotta);
}

.custom-category-inputs select {
  padding: .75rem 1rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  background: var(--white);
  cursor: pointer;
}

.custom-category-inputs input[type="color"] {
  width: 42px;
  height: 42px;
  border: 1.5px solid #ddd6c8;
  border-radius: 12px;
  cursor: pointer;
  padding: 2px;
}

.selected-categories {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #ede8e0;
  min-height: 0;
}

.selected-categories:empty {
  display: none;
}

/* ----------------- OPÇÕES DE CONVITE ----------- */
.invite-options {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.invite-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s;
}

.invite-option:hover,
.invite-option.active {
  border-color: var(--terracotta);
  background: #fdf3ee;
}

.invite-icon {
  font-size: 1.4rem;
  min-width: 32px;
  text-align: center;
}

.invite-title {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
}

.invite-desc {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
}

.invite-form {
  margin-top: 1rem;
}

.invite-link-box {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.25rem;
  background: var(--sand);
  border-radius: 12px;
  font-size: .85rem;
  color: var(--forest);
  word-break: break-all;
}

.invite-link-box span {
  flex: 1;
}

/* ----------------- LISTA DE MEMBROS ----------- */
.members-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1.25rem;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.25rem;
  background: #f0f6f3;
  border-radius: 12px;
}

.member-avatar {
  width: 36px;
  height: 36px;
  background: var(--forest);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: .85rem;
  font-weight: 500;
}

.member-name {
  font-size: .95rem;
  color: var(--text);
  font-weight: 500;
}

.member-email {
  font-size: .8rem;
  color: var(--muted);
}

/* ----------------- RESUMO FINAL ----------- */
.summary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f0f6f3;
  border-radius: 14px;
}

.summary-icon {
  font-size: 1.4rem;
  min-width: 32px;
  text-align: center;
}

.summary-label {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.summary-value {
  font-size: .95rem;
  color: var(--text);
  font-weight: 500;
  margin-top: .15rem;
}

/* ----------------- NAVEGAÇÃO ----------- */
.onboarding-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid #ede8e0;
  padding: 1rem 2rem;
  max-width: 780px;
  margin: 0 auto;
}

/* ----------------- UTILITÁRIOS ----------- */
.hidden {
  display: none !important;
}

/* -------------- BOTÃO CANCELAR CATEGORIA ----------- */
.btn-cancel-category {
  background: none;
  border: 1.5px solid var(--error);
  color: var(--error);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cancel-category:hover {
  background: var(--error);
  color: var(--white);
}

/* -------------- BOTÕES DO FORMULÁRIO DE CATEGORIA ----------- */
.custom-category-inputs .btn-secondary {
  margin-top: 0;
  height: auto;
  align-self: stretch;
}

/* ------------ NATUREZA DA CATEGORIA NO CHIP ------------- */
.category-chip small {
  font-size: .7rem;
  background: rgba(0,0,0,.06);
  padding: .15rem .4rem;
  border-radius: 99px;
  margin-left: .25rem;
  color: inherit;
}

/* -------------- GARANTE QUE PASSOS OCULTOS NÃO VAZAM CONTEÚDO ----------- */
.step.hidden {
  display: none !important;
  visibility: hidden !important;
}

/* -------------- CHECKBOX (ADICIONAR INTEGRANTE) ----------- */
.checkbox-field {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
  margin-top: .75rem;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
  cursor: pointer;
}

.checkbox-field label {
  font-size: .9rem;
  color: var(--text);
  cursor: pointer;
}

/* ----------- CAMPOS DENTRO DO FORMULÁRIO DE CONVITE --------- */
.invite-form .field {
  margin-bottom: 1rem;
}

.invite-form .field label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
}

.invite-form .field input {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 12px;
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.invite-form .field input:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(201, 113, 74, .12);
}

/* --------- SUGESTÃO DE ORÇAMENTO ----------- */
.budget-suggestion {
  margin-top: 1.5rem;
  background: #f0f6f3;
  border-radius: 16px;
  padding: 1.25rem;
}

.budget-suggestion-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  font-size: 1.2rem;
}

.budget-suggestion-title {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
}

.budget-suggestion-desc {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
}

/* ------------- GRUPO DE ORÇAMENTO ------------- */
.budget-group {
  background: var(--white);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.budget-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.budget-group-title {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  display: block;
}

.budget-group-limit {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
  display: block;
}

.budget-group-distributed {
  font-size: .8rem;
  color: var(--muted);
  text-align: right;
}

/* ------------- BARRA DE PROGRESSO DO GRUPO ------------- */
.budget-progress-bar {
  height: 6px;
  background: var(--sand);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: .75rem;
}

.budget-progress-fill {
  height: 100%;
  background: var(--forest);
  border-radius: 99px;
  transition: width .3s ease, background .3s ease;
}

/* ------------- ALERTA ------------- */
.budget-alert {
  font-size: .8rem;
  color: var(--error);
  background: #fdf0ee;
  border: 1px solid #f5c4bb;
  border-radius: 8px;
  padding: .5rem .75rem;
  margin-bottom: .75rem;
}

/* ------------- ITENS DE CATEGORIA ------------- */
.budget-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 1rem;
}

.budget-item:last-child {
  border-bottom: none;
}

.budget-cat-name {
  font-size: .9rem;
  color: var(--text);
  flex: 1;
}

.budget-input-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--muted);
}

.budget-input {
  width: 100px;
  padding: .4rem .6rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  text-align: right;
  transition: border-color .2s;
}

.budget-input:focus {
  border-color: var(--terracotta);
}

/* ---------- RESUMO DE SALDO RESTANTE ----------- */
.budget-remaining-summary {
  margin-top: 1rem;
}

.remaining-alert {
  background: #fff8e6;
  border: 1px solid #f0d080;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.remaining-alert-title {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .5rem;
}

.remaining-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid #f0d080;
  flex-wrap: wrap;
}

.remaining-item:last-of-type {
  border-bottom: none;
  margin-bottom: .75rem;
}

.remaining-item-info {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.remaining-item-label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
}

.remaining-item-value {
  font-size: .8rem;
  color: var(--muted);
}

.remaining-select {
  padding: .5rem .75rem;
  border: 1.5px solid #f0d080;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}

.remaining-select:focus {
  border-color: var(--terracotta);
}

.remaining-alert ul li {
  font-size: .85rem;
  color: var(--text);
}

.remaining-alert-tip {
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid #f0d080;
  padding-top: .75rem;
}

.remaining-success {
  background: #f0f6f3;
  border: 1px solid #b8d8c8;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: .9rem;
  color: var(--forest);
  font-weight: 500;
}

/* ══════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════ */

/* ------- BODY ------- */
.app-body {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  background: var(--cream);
  height: 100vh;
}

/* ------- SIDEBAR ------- */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--forest);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 2rem;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-brand .brand-name {
  color: var(--white);
  font-size: 1.2rem;
}

/* ------- NAVEGAÇÃO ------- */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, .65);
  font-size: .9rem;
  transition: all .2s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--white);
}

.nav-item.active {
  background: rgba(255, 255, 255, .12);
  color: var(--white);
  font-weight: 500;
}

.nav-icon {
  font-size: 1.1rem;
  min-width: 24px;
  text-align: center;
}

/* ------- RODAPÉ DA SIDEBAR ------- */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--terracotta);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: .85rem;
  font-weight: 500;
  min-width: 36px;
}

.user-name {
  font-size: .9rem;
  color: var(--white);
  font-weight: 500;
}

.user-role {
  font-size: .75rem;
  color: rgba(255, 255, 255, .5);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.btn-signout {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .65);
  padding: .6rem 1rem;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.btn-signout:hover {
  background: rgba(255, 255, 255, .12);
  color: var(--white);
}

/* ------- ÁREA PRINCIPAL ------- */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem;
  min-width: 0;
}

/* ------- CABEÇALHO DA PÁGINA ------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: .25rem;
}

.page-subtitle {
  font-size: .9rem;
  color: var(--muted);
}

/* ------- FILTROS ------- */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: .4rem;
  background: var(--white);
  border-radius: 12px;
  padding: .3rem;
  border: 1px solid #ede8e0;
}

.filter-btn {
  background: none;
  border: none;
  padding: .4rem .85rem;
  border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}

.filter-btn.active {
  background: var(--forest);
  color: var(--white);
  font-weight: 500;
}

/* ------- LISTA DE CATEGORIAS ------- */
.categories-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.loading-state {
  color: var(--muted);
  font-size: .9rem;
  grid-column: 1 / -1;
  padding: 2rem 0;
  text-align: center;
}

.empty-state {
  color: var(--muted);
  font-size: .9rem;
  grid-column: 1 / -1;
  padding: 3rem 0;
  text-align: center;
}

/* ------- CARD DE CATEGORIA ------- */
.category-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1.5px solid #ede8e0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow .2s;
}

.category-card:hover {
  box-shadow: 0 4px 16px rgba(45, 74, 62, .08);
}

.category-card-top {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.category-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  min-width: 12px;
}

.category-card-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.category-card-tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-weight: 500;
}

.tag-income   { background: #e8f5ee; color: #2d7a4f; }
.tag-expense  { background: #fdf0ee; color: #c9714a; }
.tag-fixed    { background: #eef2ff; color: #5b6dd9; }
.tag-variable { background: #f5f5f5; color: #7a8c84; }
.tag-needs    { background: #fff3e0; color: #e07b20; }
.tag-wants    { background: #fce4ec; color: #c2185b; }
.tag-savings  { background: #e8f5e9; color: #2e7d32; }

.category-card-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

.btn-edit {
  background: none;
  border: 1.5px solid #ddd6c8;
  color: var(--muted);
  padding: .4rem .85rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}

.btn-edit:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.btn-delete {
  background: none;
  border: 1.5px solid #ddd6c8;
  color: var(--muted);
  padding: .4rem .85rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}

.btn-delete:hover {
  border-color: var(--error);
  color: var(--error);
}

/* ------- MODAL ------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-card {
  background: var(--white);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
}

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

.modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}

.modal-close:hover { color: var(--error); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.5rem;
}

.modal-actions .btn-primary {
  width: auto;
  margin-top: 0;
  padding: .75rem 1.5rem;
}

/* ------- SELECT ESTILIZADO ------- */
.field select {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 12px;
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}

.field select:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(201, 113, 74, .12);
}

/* ------- RESPONSIVO ------- */
@media (max-width: 768px) {
  .app-body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 1rem;
    gap: 1rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex: none;
    width: 100%;
  }

  .sidebar-footer {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .app-main {
    padding: 1.5rem 1rem;
  }
}

/* --------- BOTÃO PRIMARY NO CABEÇALHO DA PÁGINA -------- */
.page-header .btn-primary {
  width: auto;
  margin-top: 0;
  padding: .75rem 1.5rem;
  white-space: nowrap;
}

/* ══════════════════════════════════════
   TRANSAÇÕES
══════════════════════════════════════ */

/* -------- FILTRO DE MÊS ---------- */
.filter-month {
  padding: .4rem .85rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}

.filter-month:focus {
  border-color: var(--terracotta);
}

/* -------- RESUMO DO PERÍODO ---------- */
.transactions-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.summary-pill {
  flex: 1;
  min-width: 140px;
  background: var(--white);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  border: 1.5px solid #ede8e0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.summary-pill-label {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.summary-pill-value {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
}

.summary-pill.income  { border-left: 4px solid #4caf7d; }
.summary-pill.expense { border-left: 4px solid var(--error); }
.summary-pill.balance { border-left: 4px solid var(--terracotta); }

.summary-pill.income  .summary-pill-value { color: #2d7a4f; }
.summary-pill.expense .summary-pill-value { color: var(--error); }

/* ── LISTA DE TRANSAÇÕES ── */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: 600px;
  overflow-y: auto;
  padding-right: .5rem;
  scroll-behavior: smooth;
}

/* ── SCROLLBAR CUSTOMIZADA ── */
.transactions-list::-webkit-scrollbar {
  width: 6px;
}

.transactions-list::-webkit-scrollbar-track {
  background: var(--sand);
  border-radius: 99px;
}

.transactions-list::-webkit-scrollbar-thumb {
  background: #c5bfb5;
  border-radius: 99px;
}

.transactions-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* -------- CARD DE TRANSAÇÃO ---------- */
.transaction-card {
  background: var(--white);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  border: 1.5px solid #ede8e0;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .2s;
}

.transaction-card:hover {
  box-shadow: 0 4px 16px rgba(45, 74, 62, .08);
}

.transaction-color {
  width: 4px;
  min-width: 4px;
  height: 40px;
  border-radius: 99px;
}

.transaction-info {
  flex: 1;
  min-width: 0;
}

.transaction-description {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-meta {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .2rem;
}

.transaction-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
}

.transaction-amount {
  font-size: 1rem;
  font-weight: 500;
}

.transaction-amount.income  { color: #2d7a4f; }
.transaction-amount.expense { color: var(--error); }

.transaction-date {
  font-size: .78rem;
  color: var(--muted);
}

.transaction-actions {
  display: flex;
  gap: .4rem;
  margin-left: .5rem;
}

/* ── ESTADO VAZIO ── */
.empty-transactions {
  text-align: center;
  padding: 3rem 0;
  color: var(--muted);
}

.empty-transactions p {
  font-size: .95rem;
  margin-top: .5rem;
}

/* ══════════════════════════════════════
   FAMÍLIA
══════════════════════════════════════ */

/* -------- TÍTULO DE SEÇÃO -------- */
.section-title {
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
}

/* -------- GRID DE INTEGRANTES -------- */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* -------- CARD DE INTEGRANTE -------- */
.member-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1.5px solid #ede8e0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow .2s;
}

.member-card:hover {
  box-shadow: 0 4px 16px rgba(45, 74, 62, .08);
}

.member-card-top {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.member-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: .95rem;
  font-weight: 500;
  min-width: 44px;
}

.member-card-info {
  flex: 1;
  min-width: 0;
}

.member-card-name {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-card-email {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-card-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

.btn-promote {
  background: none;
  border: 1.5px solid #ddd6c8;
  color: var(--muted);
  padding: .4rem .85rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}

.btn-promote:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.btn-demote {
  background: none;
  border: 1.5px solid #ddd6c8;
  color: var(--muted);
  padding: .4rem .85rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}

.btn-demote:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.btn-remove-member {
  background: none;
  border: 1.5px solid #ddd6c8;
  color: var(--muted);
  padding: .4rem .85rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
}

.btn-remove-member:hover {
  border-color: var(--error);
  color: var(--error);
}

/* -------- LISTA DE CONVITES PENDENTES -------- */
.invites-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.invite-card {
  background: var(--white);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  border: 1.5px solid #ede8e0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.invite-card-info {
  flex: 1;
}

.invite-card-name {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
}

.invite-card-meta {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
}

.invite-card-actions {
  display: flex;
  gap: .5rem;
}

.tag-pending {
  background: #fff8e6;
  color: #b07d00;
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-weight: 500;
}

.tag-admin {
  background: #eef2ff;
  color: #5b6dd9;
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-weight: 500;
}

.tag-member {
  background: #f5f5f5;
  color: #7a8c84;
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-weight: 500;
}

.empty-invites {
  color: var(--muted);
  font-size: .9rem;
  padding: 1.5rem 0;
  text-align: center;
}

/* ══════════════════════════════════════
   DASHBOARD
══════════════════════════════════════ */

/* ------- CARDS DE RESUMO --------- */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  border: 1.5px solid #ede8e0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  transition: box-shadow .2s;
}

.dashboard-card:hover {
  box-shadow: 0 4px 16px rgba(45, 74, 62, .08);
}

.dashboard-card-label {
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.dashboard-card-value {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}

.dashboard-card-sub {
  font-size: .8rem;
  color: var(--muted);
}

.dashboard-card.balance { border-left: 4px solid var(--terracotta); }
.dashboard-card.income  { border-left: 4px solid #4caf7d; }
.dashboard-card.expense { border-left: 4px solid var(--error); }

.dashboard-card.income  .dashboard-card-value { color: #2d7a4f; }
.dashboard-card.expense .dashboard-card-value { color: var(--error); }

/* ------- GRID DE PAINÉIS --------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ------- PAINEL --------- */
.dashboard-panel {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1.5px solid #ede8e0;
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--text);
}

/* --------- GRÁFICO DE ROSCA --------- */
.chart-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 1.25rem;
}

.chart-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.chart-center-value {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

.chart-center-label {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* --------- LEGENDA DO GRÁFICO ---------- */
.chart-legend {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 200px;
  overflow-y: auto;
  padding-right: .25rem;
}

.chart-legend::-webkit-scrollbar {
  width: 4px;
}

.chart-legend::-webkit-scrollbar-track {
  background: var(--sand);
  border-radius: 99px;
}

.chart-legend::-webkit-scrollbar-thumb {
  background: #c5bfb5;
  border-radius: 99px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .82rem;
  color: var(--text);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  min-width: 10px;
}

.legend-name {
  flex: 1;
}

.legend-value {
  font-weight: 500;
  color: var(--text);
}

.legend-percent {
  color: var(--muted);
  font-size: .75rem;
  min-width: 36px;
  text-align: right;
}

/* ------- PROGRESSO DO ORÇAMENTO --------- */
.budget-progress-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: .25rem;
}

.budget-progress-list::-webkit-scrollbar {
  width: 4px;
}

.budget-progress-list::-webkit-scrollbar-track {
  background: var(--sand);
  border-radius: 99px;
}

.budget-progress-list::-webkit-scrollbar-thumb {
  background: #c5bfb5;
  border-radius: 99px;
}

.budget-progress-item {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.budget-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.budget-progress-name {
  font-size: .85rem;
  color: var(--text);
  font-weight: 500;
}

.budget-progress-values {
  font-size: .78rem;
  color: var(--muted);
}

.budget-progress-bar {
  height: 8px;
  background: var(--sand);
  border-radius: 99px;
  overflow: hidden;
}

.budget-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}

.budget-progress-alert {
  font-size: .75rem;
  color: var(--error);
  margin-top: .15rem;
}

/* ------- BOTÃO EXTRATO --------- */
.dashboard-footer {
  display: flex;
  justify-content: center;
  margin-top: .5rem;
}

.btn-extrato {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 2rem;
  background: var(--white);
  border: 1.5px solid #ede8e0;
  border-radius: 12px;
  color: var(--forest);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s;
}

.btn-extrato:hover {
  background: var(--forest);
  color: var(--white);
  border-color: var(--forest);
}

/* ------- RESPONSIVO --------- */
@media (max-width: 900px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════
   CONFIGURAÇÕES
══════════════════════════════════════ */

/* ---------- SEÇÃO ---------- */
.settings-section {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1.5px solid #ede8e0;
  margin-bottom: 1.5rem;
}

.settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.settings-section-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .3rem;
}

.settings-section-desc {
  font-size: .85rem;
  color: var(--muted);
}

/* ------ LISTA DE ORÇAMENTO -------- */
.settings-budget-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: .5rem;
  scroll-behavior: smooth;
}

.settings-budget-list::-webkit-scrollbar {
  width: 6px;
}

.settings-budget-list::-webkit-scrollbar-track {
  background: var(--sand);
  border-radius: 99px;
}

.settings-budget-list::-webkit-scrollbar-thumb {
  background: #c5bfb5;
  border-radius: 99px;
}

.settings-budget-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.settings-budget-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--cream);
  border-radius: 12px;
  border: 1.5px solid #ede8e0;
  flex-wrap: wrap;
}

.settings-budget-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  min-width: 10px;
}

.settings-budget-name {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 120px;
}

.settings-budget-tags {
  display: flex;
  gap: .4rem;
}

.settings-budget-input-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--muted);
}

.settings-budget-input {
  width: 120px;
  padding: .5rem .75rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  text-align: right;
  transition: border-color .2s;
  background: var(--white);
}

.settings-budget-input:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(201, 113, 74, .12);
}

/* ----- AÇÕES ------- */
.settings-actions {
  margin-top: 1.25rem;
  display: flex;
  justify-content: flex-end;
}

.settings-actions .btn-primary {
  width: auto;
  margin-top: 0;
  padding: .75rem 1.5rem;
}

/* --------- INTEGRANTES REMOVIDOS --------- */
.removed-members-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.removed-member-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--cream);
  border-radius: 12px;
  border: 1.5px solid #ede8e0;
}

.removed-member-info {
  flex: 1;
}

.removed-member-name {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
}

.removed-member-meta {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
}

.btn-reactivate {
  background: none;
  border: 1.5px solid var(--forest);
  color: var(--forest);
  padding: .5rem 1rem;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}

.btn-reactivate:hover {
  background: var(--forest);
  color: var(--white);
}

.empty-removed {
  text-align: center;
  padding: 1.5rem 0;
  font-size: .9rem;
  color: var(--muted);
}

/* ---------- ASSINATURA ---------- */
.subscription-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: var(--cream);
  border-radius: 12px;
  border: 1.5px solid #ede8e0;
  gap: 1rem;
  flex-wrap: wrap;
}

.subscription-info {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.subscription-plan {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.subscription-meta {
  font-size: .85rem;
  color: var(--muted);
}

.subscription-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .8rem;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 500;
}

.subscription-badge.trial {
  background: #fff8e6;
  color: #b07d00;
}

.subscription-badge.active {
  background: #e8f5ee;
  color: #2d7a4f;
}

.subscription-badge.blocked {
  background: #fdf0ee;
  color: var(--error);
}

.btn-subscribe {
  background: var(--terracotta);
  color: var(--white);
  border: none;
  padding: .75rem 1.5rem;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
  opacity: .6;
  cursor: not-allowed;
}

/* -------- BANNER DE RENDA -------- */
.income-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1.5px solid #ede8e0;
  border-left: 4px solid #4caf7d;
  border-radius: 14px;
  padding: .9rem 1.25rem;
  margin-bottom: 1rem;
}

.income-banner-label {
  font-size: .85rem;
  color: var(--muted);
}

.income-banner-value {
  font-size: 1.1rem;
  font-weight: 500;
  color: #2d7a4f;
}

/* -------- ORÇAMENTO VAZIO --------- */
.budget-empty-month {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  gap: .75rem;
}

.budget-empty-icon {
  font-size: 2rem;
}

.budget-empty-text {
  font-size: .9rem;
  color: var(--muted);
}

.budget-empty-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: .5rem;
}

.budget-empty-actions .btn-secondary {
  margin-top: 0;
}

.budget-empty-actions .btn-ghost {
  padding: .65rem 1.25rem;
  border: 1.5px solid #ddd6c8;
  border-radius: 12px;
  font-size: .875rem;
  text-decoration: none;
  color: var(--muted);
  transition: all .2s;
}

.budget-empty-actions .btn-ghost:hover {
  border-color: var(--forest);
  color: var(--forest);
}

/* ══════════════════════════════════════
   MOBILE HEADER + TOGGLE SIDEBAR
══════════════════════════════════════ */

/* ── HEADER MOBILE ── */
.mobile-header {
  display: none;
}

/* ── OVERLAY ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 98;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 768px) {

  /* ── HEADER MOBILE ── */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .875rem 1rem;
    background: var(--white);
    border-bottom: 1px solid #ede8e0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 97;
  }

  .mobile-menu-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--forest);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: background .2s;
  }

  .mobile-menu-btn:hover {
    background: var(--sand);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
  }

  .mobile-brand .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .mobile-brand .brand-name {
    font-size: 1.1rem;
  }

  /* ------ SIDEBAR MOBILE -------- */
  .app-body {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    height: 100dvh; /* evita corte em Safari/IOS */
    z-index: 99;
    transition: left .3s ease;
    overflow-y: auto;
    min-width: unset;
    display: flex;
    flex-direction: column;
  }

  .sidebar-brand {
    padding-top: .75rem;
  }
  
  .sidebar-footer {
    margin-top: auto;
    padding-bottom: env (safe-area-inset-bottom, 0px); /* respeita notch do iPhone*/
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-nav {
    flex-direction: column;
  }

  .nav-item {
    flex-direction: row;
    font-size: .9rem;
  }

  /* ------ ÁREA PRINCIPAL -------- */
  .app-main {
    padding: 5rem 1rem 2rem;
    overflow-y: auto;
    height: 100vh;
    width: 100%;
  }

  /* ------ CARDS DE RESUMO -------- */
  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  /* ------ GRID DO DASHBOARD -------- */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* ------ FILTRO DE MÊS -------- */
  .filter-month {
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
  }

  .page-header .btn-primary {
    width: 100%;
  }

  /* ------ CARDS DE TRANSAÇÃO -------- */
  .transaction-card {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .transaction-right {
    align-items: flex-start;
    width: 100%;
  }

  .transaction-actions {
    margin-left: auto;
  }

  /* ------ CONFIGURAÇÕES -------- */
  .settings-section-header {
    flex-direction: column;
  }

  .settings-budget-item {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .settings-budget-input-wrap {
    width: 100%;
    justify-content: flex-end;
  }

  /* ------ BANNER DE RENDA -------- */
  .income-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
  }

  /* ------ SUBSCRIPTION CARD -------- */
  .subscription-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-subscribe {
    width: 100%;
  }
}