/* ── Reset & Vars ── */
:root {
  --primary:        #6C63FF;
  --primary-dark:   #4B44CC;
  --income:         #00C48C;
  --expense:        #FF647C;
  --bg:             #F0F1F8;
  --card:           #FFFFFF;
  --text:           #1A1D2E;
  --text-muted:     #7B7F9E;
  --nav-h:          68px;
  --radius:         20px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  background: #D8DAE8;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* ── App shell ── */
#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* ── Header ── */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 6px 24px 28px;
  border-radius: 0 0 28px 28px;
  flex-shrink: 0;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.app-name {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s;
}
.avatar-btn:hover { background: rgba(255,255,255,0.25); }

/* ── Top Nav ── */
.top-nav {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 4px;
  margin-bottom: 18px;
  position: relative;
}

.top-nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.top-nav-menu {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}
.top-nav-menu:hover,
.top-nav-menu:focus { background: rgba(255,255,255,0.28); outline: none; }

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.top-nav-logo {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.top-nav-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border-radius: 20px;
  padding: 4px 10px 4px 7px;
  box-shadow: 0 1px 5px rgba(0,0,0,.10);
}
.top-nav-chip .tnc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.top-nav-chip .tnc-nome {
  color: var(--text);
  font-weight: 700;
  font-size: 0.78rem;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-label {
  display: block;
  color: rgba(255,255,255,0.72);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.balance-accent-line {
  display: block;
  height: 4px;
  width: 136px;
  border: 1px solid rgba(255, 255, 255, 0.144);
  border-radius: 2px;
  margin-bottom: 10px;
  opacity: 0.85;
}

.balance-amount {
  display: block;
  color: white;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}

.balance-row {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.13);
  border-radius: 16px;
  padding: 14px 18px;
  gap: 12px;
}

.balance-metric {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  color: white;
}
.income-icon  { background: var(--income); }
.expense-icon { background: var(--expense); }

.metric-label {
  display: block;
  color: rgba(255,255,255,0.68);
  font-size: 0.72rem;
  font-weight: 500;
}
.metric-value {
  display: block;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.balance-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.22);
}

/* ── Main ── */
main {
  flex: 1;
  padding: 24px 20px;
  padding-bottom: calc(var(--nav-h) + 16px);
  overflow-x: hidden;
  overflow-y: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.section-link {
  font-size: 0.78rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* ── Transaction cards ── */
.transaction-item {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  gap: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.transaction-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.income-tx  { background: rgba(0,196,140,0.12); color: var(--income); }
.expense-tx { background: rgba(255,100,124,0.12); color: var(--expense); }

.transaction-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.transaction-name {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transaction-date {
  font-size: 0.73rem;
  color: var(--text-muted);
}
.transaction-value {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.income-color  { color: var(--income); }
.expense-color { color: var(--expense); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 2.8rem;
  margin-bottom: 14px;
  display: block;
  opacity: 0.35;
}
.empty-state p {
  font-size: 0.9rem;
}
.empty-hint {
  font-size: 0.75rem !important;
  margin-top: 6px;
  opacity: 0.7;
}

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: white;
  border-top: 1px solid rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: 500;
  padding: 6px 0;
  min-width: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.nav-item i { font-size: 1.15rem; }
.nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav-item.active { color: var(--primary); }

.nav-add { margin-top: -20px; }

.add-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  box-shadow: 0 4px 18px rgba(108,99,255,0.42);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.add-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(108,99,255,0.54);
}

/* ── Bottom Sheet ── */
#sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,30,0.5);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#sheet-overlay.open { display: flex; }

#sheet {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 10px 24px 40px;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}
#sheet-overlay.open #sheet { transform: translateY(0); }

/* Sheet panels */
.sheet-panel { display: none; flex-direction: column; }
.sheet-panel.active { display: flex; }

/* ── Sheet header ── */
.sheet-header {
  display: flex;
  align-items: center;
  padding: 14px 4px 14px;
  gap: 4px;
  border-bottom: 1px solid #F0F1F8;
  margin-bottom: 18px;
}
.sheet-cur-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.sheet-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #F4F5FC;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.sheet-nav-btn:hover { background: #E8E9F5; }

/* Backward-compat styles for other pages still using old sheet classes */
.sheet-handle {
  width: 40px;
  height: 4px;
  background: #DDE0EF;
  border-radius: 2px;
  margin: 6px auto 22px;
}
.sheet-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0;
  cursor: pointer;
  width: fit-content;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.sheet-back:hover { color: var(--text); }
.sheet-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.sheet-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* Choice buttons */
.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F4F5FC;
  border: 1.5px solid transparent;
  border-radius: 16px;
  padding: 15px 16px;
  margin-bottom: 12px;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.choice-btn:hover {
  background: #ECEDF8;
  border-color: rgba(108,99,255,0.25);
}

.choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.income-icon-soft  { background: rgba(0,196,140,0.14); color: var(--income); }
.expense-icon-soft { background: rgba(255,100,124,0.14); color: var(--expense); }

.choice-text { flex: 1; }
.choice-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.choice-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.choice-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Form */
.input-group-custom { margin-bottom: 16px; }
.input-group-custom label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.input-field {
  width: 100%;
  background: #F4F5FC;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 13px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.93rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input-field:focus {
  border-color: var(--primary);
  background: white;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s, transform 0.1s;
}
.submit-btn:hover { opacity: 0.88; transform: scale(0.99); }
.income-btn  { background: var(--income); }
.expense-btn { background: var(--expense); }

/* ── Extras (forms) ── */
.balance-month {
  display: block;
  color: rgba(255,255,255,0.55);
  font-size: 0.72rem;
  text-align: center;
  margin-top: 10px;
}

.form-error {
  color: var(--expense);
  font-size: 0.78rem;
  margin-top: 8px;
  min-height: 1em;
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237B7F9E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ── Transaction form grid ── */
.tx-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.tx-col-full { grid-column: span 2; }

/* ── Toggle fixo (used in other pages) ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F4F5FC;
  border-radius: 12px;
  padding: 12px 14px;
}
.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: default;
}
.toggle-label span:first-child {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}
.toggle-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #D0D3E8;
  border-radius: 24px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Alertas de compromissos fixos ── */
.alertas-section {
  margin: 12px 12px 4px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(26,29,46,.06);
}
.alertas-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(123,127,158,.1);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.alertas-header .fas { color: var(--expense); }
.alertas-ver-todos {
  margin-left: auto;
  font-size: .78rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.alerta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px solid rgba(123,127,158,.06);
  transition: background .15s;
}
.alerta-item:last-child { border-bottom: none; }
.alerta-item:hover { background: var(--bg); }
.alerta-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.alerta-gasto  .alerta-icon { background: rgba(255,100,124,.1); color: var(--expense); }
.alerta-receita .alerta-icon { background: rgba(0,196,140,.1); color: var(--income); }
.alerta-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.alerta-nome {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alerta-dia { font-size: .72rem; color: var(--text-muted); }
.alerta-valor { font-size: .85rem; font-weight: 700; flex-shrink: 0; }

/* ── Nav alert dot ── */
.nav-badge {
  position: absolute;
  top: 3px;
  right: 10px;
  width: 7px;
  height: 7px;
  background: var(--expense);
  border-radius: 50%;
  border: 1.5px solid var(--card);
}
.nav-item { position: relative; }

/* ── Carteira Chip (header) ── */
.carteira-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 11px 5px 8px;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity .2s;
  align-self: flex-start;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
}
.carteira-chip:active { opacity: .82; }
.carteira-chip .cc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.carteira-chip .cc-nome { font-size: .78rem; font-weight: 700; color: var(--text); }
.carteira-chip .cc-icon { font-size: .62rem; color: var(--text-light); }

/* ── Side Menu ── */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.menu-overlay.open { opacity: 1; pointer-events: all; }

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: #fff;
  z-index: 201;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.side-menu.open { transform: translateX(0); }

.side-menu-header {
  background: linear-gradient(135deg, var(--primary), #9b59b6);
  padding: 48px 20px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.menu-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.menu-user-info { flex: 1; overflow: hidden; }
.menu-user-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-user-at { font-size: .8rem; color: rgba(255,255,255,.75); }

.side-menu-section {
  padding: 16px 0 4px;
  border-bottom: 1px solid #f0f1f8;
}
.side-menu-section:last-child { border-bottom: none; }
.side-menu-section-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-light);
  text-transform: uppercase;
  padding: 0 20px 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font: 500 .95rem/1.2 'Inter', sans-serif;
  color: var(--text);
  transition: background .15s;
}
.menu-item:active { background: #f5f5fb; }
.menu-item .mi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.mi-icon-purple { background: #ede9ff; color: var(--primary); }
.mi-icon-blue   { background: #e0f0ff; color: #3b82f6; }
.mi-icon-red    { background: #fff0f2; color: var(--expense); }
.menu-item .mi-arrow { margin-left: auto; color: var(--text-light); font-size: .75rem; }
.menu-item.logout-item { color: var(--expense); }
.menu-item.logout-item .mi-icon { background: #fff0f2; color: var(--expense); }

/* ── Side menu footer ── */
.side-menu-footer {
  margin-top: auto;
  padding: 16px 20px 28px;
  border-top: 1px solid #f0f1f8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-menu-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 20px;
  transition: background .15s, color .15s;
  font-family: 'Inter', sans-serif;
}
.side-menu-footer-link:hover,
.side-menu-footer-link:active { background: #f0f1f8; color: var(--primary); }

/* ── Modal Sobre ── */
#modal-sobre-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,30,60,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
#modal-sobre-overlay.open { display: flex; }
#modal-sobre {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  animation: slideUpModal .28s cubic-bezier(.4,0,.2,1) both;
}
@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-sobre-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 0;
  flex-shrink: 0;
}
.modal-sobre-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.modal-sobre-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f1f8;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: background .15s;
  flex-shrink: 0;
}
.modal-sobre-close:hover { background: #e8e9f5; color: var(--text); }
.modal-sobre-body {
  overflow-y: auto;
  padding: 18px 22px 26px;
  -webkit-overflow-scrolling: touch;
}
.modal-sobre-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}
.modal-sobre-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  overflow: hidden;
}
.modal-sobre-logo-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.01em;
}
.modal-sobre-tagline {
  font-size: .78rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.5;
}
.modal-sobre-block {
  margin-bottom: 18px;
}
.modal-sobre-block-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--primary);
  margin-bottom: 6px;
}
.modal-sobre-block p {
  font-size: .88rem;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  text-align: justify;
  hyphens: auto;
}
.modal-sobre-divider {
  height: 1px;
  background: #f0f1f8;
  margin: 18px 0;
}
.modal-sobre-bitvi {
  background: linear-gradient(135deg, #f5f3ff, #ede9ff);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.modal-sobre-bitvi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .9rem;
  flex-shrink: 0;
  overflow: hidden;
}
.modal-sobre-bitvi-text strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.modal-sobre-bitvi-text span {
  font-size: .8rem;
  color: var(--text-light);
  line-height: 1.5;
}
.modal-sobre-bitvi-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: opacity .15s;
}
.modal-sobre-bitvi-link:hover { opacity: .75; }

/* ── Carteira cards — compact redesign ── */
.carteira-card {
  margin: 6px 16px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid #eee;
  transition: border-color .2s;
}
.carteira-card.is-ativa { border-color: var(--primary); background: #fafaff; }

.carteira-card-row { display: flex; align-items: center; }

.carteira-ativar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 12px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.carteira-ativar-btn:active { background: #f5f5fb; }

.carteira-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.cc-nome-card {
  flex: 1;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carteira-badge {
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  background: #ede9ff;
  color: var(--primary);
  letter-spacing: .03em;
  flex-shrink: 0;
}
.cc-ativa-icon { color: var(--primary); font-size: .9rem; flex-shrink: 0; }

.carteira-action-btns { display: flex; gap: 1px; padding-right: 8px; flex-shrink: 0; }
.ca-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--text-light);
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.ca-btn:hover, .ca-btn.active { background: #ede9ff; color: var(--primary); }
.ca-btn.danger:hover { background: #fff0f2; color: var(--expense); }

/* Expandable panel per card */
.cw-panel {
  border-top: 1px solid #f0f1f8;
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.cw-panel.open { display: flex; }
.cw-panel-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-light);
  text-transform: uppercase;
}

/* Metas form */
.meta-input-row { display: flex; flex-direction: column; gap: 4px; }
.meta-input-row label { font-size: .75rem; font-weight: 600; color: var(--text-light); }
.meta-input-row input {
  padding: 8px 10px;
  border: 1.5px solid #e2e3f0;
  border-radius: 10px;
  font: 500 .9rem/1 'Inter', sans-serif;
  color: var(--text);
  outline: none;
}
.meta-input-row input:focus { border-color: var(--primary); }
.meta-calc-row {
  background: #f5f5fb;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--text-light);
}
.meta-calc-row strong { color: var(--primary); }
.btn-salvar-meta {
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font: 600 .85rem/1 'Inter', sans-serif;
  cursor: pointer;
}

/* Edit carteira inline form */
.carteira-edit-form { display: flex; flex-direction: column; gap: 8px; }
.carteira-edit-form input[type="text"] {
  padding: 8px 10px;
  border: 1.5px solid #e2e3f0;
  border-radius: 10px;
  font: 500 .9rem/1 'Inter', sans-serif;
  color: var(--text);
  outline: none;
}
.carteira-edit-form input[type="text"]:focus { border-color: var(--primary); }
.carteira-edit-form .edit-actions { display: flex; gap: 6px; }
.carteira-edit-form .edit-actions button {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  border: none;
  font: 600 .82rem/1 'Inter', sans-serif;
  cursor: pointer;
}
.btn-cancelar-edit { background: #f0f1f8; color: var(--text-light); }
.btn-salvar-edit   { background: var(--primary); color: #fff; }

/* Members list */
.carteira-membro-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .83rem;
  color: var(--text);
}
.carteira-membro-row .cm-at { color: var(--text-light); font-size: .78rem; }
.carteira-membro-row button {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--expense);
  font-size: .75rem;
  cursor: pointer;
  padding: 4px;
}
.carteira-dono-tag {
  font-size: .7rem;
  color: var(--primary);
  background: #ede9ff;
  border-radius: 20px;
  padding: 1px 7px;
  margin-left: auto;
}

/* Share search */
.carteira-share-row { display: flex; gap: 6px; }
.carteira-share-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid #e2e3f0;
  border-radius: 10px;
  font: 500 .82rem/1 'Inter', sans-serif;
  outline: none;
  color: var(--text);
}
.carteira-share-row input:focus { border-color: var(--primary); }
.carteira-share-btn {
  padding: 8px 12px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.carteira-search-results {
  background: #fafafa;
  border: 1px solid #e2e3f0;
  border-radius: 10px;
  overflow: hidden;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f1f8;
  font-size: .85rem;
  color: var(--text);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:active { background: #f0f0fa; }
.search-result-item .sri-at { color: var(--text-light); font-size: .78rem; margin-left: auto; }

.btn-nova-carteira {
  margin: 10px 16px 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px dashed #c4c2ef;
  border-radius: 12px;
  background: none;
  color: var(--primary);
  font: 600 .85rem/1 'Inter', sans-serif;
  cursor: pointer;
  width: calc(100% - 32px);
}
.btn-nova-carteira:active { background: #fafaff; }

/* Nova carteira inline form */
.nova-carteira-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin: 0 16px;
  padding: 14px;
  background: #fafafa;
  border: 1.5px solid #e2e3f0;
  border-radius: 14px;
}
.nova-carteira-form.open { display: flex; }
.nova-carteira-form input {
  padding: 10px 12px;
  border: 1.5px solid #e2e3f0;
  border-radius: 10px;
  font: 500 .9rem/1 'Inter', sans-serif;
  color: var(--text);
  outline: none;
}
.nova-carteira-form input:focus { border-color: var(--primary); }
.cor-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.cor-opt {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .15s;
}
.cor-opt.selected { border-color: var(--text); }
.nova-carteira-actions { display: flex; gap: 8px; }
.nova-carteira-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  font: 600 .85rem/1 'Inter', sans-serif;
  cursor: pointer;
  border: none;
}
.btn-cancelar-carteira { background: #f0f1f8; color: var(--text-light); }
.btn-salvar-carteira   { background: var(--primary); color: #fff; }

