@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
  /* Fundo (dark) */
  --bg-0: #0B0F1A;
  /* página */
  --bg-1: #0F1524;
  /* seção/surface */

  /* Texto */
  --text: #F2F5F9;
  /* branco suave */
  --muted: #A7B0BE;
  /* cinza legível */

  /* Títulos (roxo) */
  --brand: #7C3AED;
  /* primário p/ headings e destaques */
  --brand-strong: #6D28D9;
  /* hover/ênfase */

  /* Ação (ciano, toque tech) */
  --primary: #06B6D4;
  --primary-strong: #0891B2;

  /* Estados */
  --success: #22C55E;
  /* verde */
  --warning: #F59E0B;
  /* âmbar */
  --danger: #EF4444;
  /* vermelho */
  --info: #3B82F6;
  /* azul */

  /* Bordas/sutilezas */
  --border: #263044;

  /* Rings (8-digit hex = #RRGGBBAA) */
  --ring-brand: #7C3AED55;
  --ring-primary: #06B6D455;

  /* Primary steps */
  --primary-hover: #0891B2;
  --primary-active: #0E7490;

  /* Brand steps (roxos) */
  --brand-hover: #6D28D9;
  --brand-active: #5B21B6;

  /* Success/Warning/Danger/Info steps */
  --success-hover: #16A34A;
  --success-active: #15803D;

  --warning-hover: #D97706;
  --warning-active: #B45309;

  --danger-hover: #DC2626;
  --danger-active: #B91C1C;

  --info-hover: #2563EB;
  --info-active: #1D4ED8;

  /* Neutro (estilo GitHub) */
  --neutral: #1F2937;
  --neutral-hover: #111827;
  --neutral-active: #0B1220;
  --neutral-text: #F2F5F9;
  --neutral-border: #263044;

  /* Ghost/overlay para hovers (8-digit hex) */
  --ghost-brand: #7C3AED1A;
  --ghost-primary: #06B6D41A;
  --ghost-neutral: #FFFFFF0D;

  --modal-backdrop: #0B0F1ACC;     /* overlay */
  --modal-bg: var(--bg-1);         /* fundo modal */
  --modal-border: var(--neutral-border);
  --modal-title: var(--brand);
  --modal-text: var(--text);
  --modal-muted: var(--muted);
  --modal-shadow: 0 20px 60px #00000088;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border: none;
  text-decoration: none;
  list-style: none;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  line-height: 1.55;
}

.error-wrapper {
  width: 90%;
  max-width: 300px;
  margin: 2% auto;
  text-align: center;
}

.error-wrapper h1 {
  color: var(--brand);
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

.error-wrapper p {
  color: var(--text);
  font-weight: 100;
  opacity: 0.6;
}

.error-wrapper p:last-of-type {
  font-weight: 700;
  margin-top: 3rem;
  font-size: 0.6rem;
  text-transform: uppercase;
}

.error-wrapper a {
  margin-top: 1rem;
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  background-color: var(--danger);
  color: var(--text);
  display: flex;
  justify-self: center;
  justify-content: center;
  align-items: center;
  width: 80px;
}

.login-wrapper {
  width: 90%;
  border: 1px solid var(--border);
  background-color: var(--bg-1);
  max-width: 600px;
  padding: 1rem;
  border-radius: 10px;
  margin: 2% auto;
  text-align: center;
}

.login-wrapper img {
  max-width: 120px;
}

.input-group {
  width: 100%;
  margin-bottom: 1rem;
  text-align: left;
}

.input-group label {
  display: block;
  font-weight: 100;
  text-transform: uppercase;
  font-size: 0.6rem;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 5px;
  outline: none;
  border: 1px solid transparent;
  background-color: #FFFFFF20;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border: 1px solid var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .70rem 1rem;
  font-weight: 700;
  font-size: .875rem;
  line-height: 1;
  border-radius: .5rem;
  border: 1px solid transparent;
  cursor: pointer;
  color: #F2F5F9;
  background: #1F2937;
  transition: background .15s ease, border-color .15s ease, transform .06s ease, box-shadow .15s ease, color .15s ease, opacity .15s ease;
  user-select: none;
}

.btn:hover {
  transform: translateY(0px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus {
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--ring-brand);
}

.btn:disabled,
.btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.btn--sm {
  padding: .5rem .75rem;
  font-size: .8125rem;
  border-radius: .45rem;
}

.btn--lg {
  padding: .9rem 1.25rem;
  font-size: 1rem;
  border-radius: .6rem;
}

.btn--block {
  width: 100%;
  display: inline-flex;
}

.btn .fa {
  font-size: 1rem;
}

.btn--primary,
.btn-primary {
  background: var(--primary);
  border-color: #0AAFD0;
  color: #001014;
}

.btn--primary:hover,
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: #0A7E96;
  color: #E7FBFF;
}

.btn--primary:active,
.btn-primary:active {
  background: var(--primary-active);
}

.btn--brand {
  background: var(--brand);
  border-color: #8451F0;
  color: #0E061D;
}

.btn--brand:hover {
  background: var(--brand-hover);
  border-color: #5F32D1;
  color: #F5F1FF;
}

.btn--brand:active {
  background: var(--brand-active);
}

.btn--success,
.btn-success {
  background: var(--success);
  border-color: #26B85A;
  color: #031207;
}

.btn--success:hover,
.btn-success:hover {
  background: var(--success-hover);
  border-color: #167C3F;
  color: #DFFBEA;
}

.btn--success:active,
.btn-success:active {
  background: var(--success-active);
}

.btn--warning,
.btn-warning {
  background: var(--warning);
  border-color: #E7930A;
  color: #1F1503;
}

.btn--warning:hover,
.btn-warning:hover {
  background: var(--warning-hover);
  border-color: #9A6508;
  color: #FFF4DC;
}

.btn--warning:active,
.btn-warning:active {
  background: var(--warning-active);
}

.btn--danger,
.btn-danger {
  background: var(--danger);
  border-color: #E53D3D;
  color: #FFFFFF;
}

.btn--danger:hover,
.btn-danger:hover {
  background: var(--danger-hover);
  border-color: #991B1B;
  color: #FFECEC;
}

.btn--danger:active,
.btn-danger:active {
  background: var(--danger-active);
}

.btn--info,
.btn-info {
  background: var(--info);
  border-color: #3A7BFA;
  color: #061127;
}

.btn--info:hover,
.btn-info:hover {
  background: var(--info-hover);
  border-color: #1F4FD8;
  color: #E9F1FF;
}

.btn--info:active,
.btn-info:active {
  background: var(--info-active);
}

.btn--neutral {
  background: var(--neutral);
  border-color: var(--neutral-border);
  color: var(--neutral-text);
}

.btn--neutral:hover {
  background: var(--neutral-hover);
}

.btn--neutral:active {
  background: var(--neutral-active);
}

.btn--outline {
  background: transparent;
  color: var(--text);
}

.btn--outline.btn--primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--outline.btn--primary:hover {
  background: var(--ghost-primary);
}

.btn--outline.btn--brand {
  border-color: var(--brand);
  color: var(--brand);
}

.btn--outline.btn--brand:hover {
  background: var(--ghost-brand);
}

.btn--outline.btn--neutral {
  border-color: var(--neutral-border);
  color: var(--text);
}

.btn--outline.btn--neutral:hover {
  background: var(--ghost-neutral);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}

.btn--ghost.btn--brand:hover {
  background: var(--ghost-brand);
}

.btn--ghost.btn--primary:hover {
  background: var(--ghost-primary);
}

.btn--ghost.btn--neutral:hover {
  background: var(--ghost-neutral);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
}

.btn.is-loading>.label {
  opacity: .75;
}

.btn.is-loading::after {
  content: "";
  width: 1em;
  height: 1em;
  border-radius: 999px;
  border: 2px solid #FFFFFF33;
  border-top-color: #FFFFFF;
  animation: spin 1s linear infinite;
}

.btn-group {
  display: inline-flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: .75rem 1rem;
  padding: .9rem 1rem;
  border-radius: .75rem;
  border: 1px solid var(--neutral-border);
  background: var(--bg-1);
  color: var(--text);
}

.alert__icon {
  line-height: 1;
  margin-top: .1rem;
  color: #E2E8F0;
}

.alert__title {
  font-weight: 800;
  margin: .1rem 0 .25rem;
}

.alert__desc {
  color: var(--muted);
}

.alert__close {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: .5rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.alert__close:hover {
  background: #FFFFFF0D;
  color: #FFFFFF;
}

.alert__close:focus-visible {
  box-shadow: 0 0 0 3px var(--ring-brand);
}

.alert--info {
  border-color: #3B82F655;
  background: #3B82F61F;
}

.alert--success {
  border-color: #22C55E55;
  background: #22C55E1F;
}

.alert--warning {
  border-color: #F59E0B55;
  background: #F59E0B1F;
}

.alert--danger {
  border-color: #EF444455;
  background: #EF44441F;
}

.alert--solid.alert--info {
  background: #1E3A8A;
  border-color: #1D4ED8;
}

.alert--solid.alert--success {
  background: #14532D;
  border-color: #16A34A;
}

.alert--solid.alert--warning {
  background: #78350F;
  border-color: #D97706;
  color: #FFF4DC;
}

.alert--solid.alert--danger {
  background: #7F1D1D;
  border-color: #DC2626;
}

.login-actions {
  width: 100%;
  text-align: right;
  margin-top: 2rem;
}

.login-actions a {
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
}

/* Mini Wallet — SweetAlert2 Theme */
.mw-swal__popup {
  background-color: var(--bg-1) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  padding: 1.2rem 1.2rem 1rem !important;
}

.mw-swal__title {
  color: var(--brand) !important;
  font-weight: 800 !important;
  margin-bottom: .35rem !important;
}

.mw-swal__html {
  color: var(--text) !important;
  opacity: .95;
}

.mw-swal__close {
  color: var(--muted) !important;
}

.mw-swal__close:hover {
  color: var(--text) !important;
}

.mw-swal__actions {
  gap: .5rem !important;
}

/* Ícones com as cores do tema */
.swal2-icon.swal2-success {
  border-color: var(--success) !important;
  color: var(--success) !important;
}

.swal2-icon.swal2-warning {
  border-color: var(--warning) !important;
  color: var(--warning) !important;
}

.swal2-icon.swal2-error {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

.swal2-icon.swal2-info {
  border-color: var(--info) !important;
  color: var(--info) !important;
}

.swal2-icon.swal2-question {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Botões (estilo tech, coerente com o resto) */
.mw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .70rem 1rem;
  font-weight: 700;
  font-size: .875rem;
  line-height: 1;
  border-radius: .5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .06s ease, color .15s ease;
}

.mw-btn:focus {
  outline: none;
}

.mw-btn:focus-visible {
  box-shadow: 0 0 0 3px #7C3AED55;
}

.mw-btn:active {
  transform: translateY(1px);
}

.mw-btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.mw-btn--primary {
  background: var(--primary);
  border-color: #0AAFD0;
  color: #001014;
}

.mw-btn--primary:hover {
  background: #0891B2;
  border-color: #0A7E96;
  color: #E7FBFF;
}

.mw-btn--brand {
  background: var(--brand);
  border-color: #8451F0;
  color: #0E061D;
}

.mw-btn--brand:hover {
  background: #6D28D9;
  border-color: #5F32D1;
  color: #F5F1FF;
}

.mw-btn--danger {
  background: var(--danger);
  border-color: #E53D3D;
  color: #2A0707;
}

.mw-btn--danger:hover {
  background: #DC2626;
  border-color: #991B1B;
  color: #FFECEC;
}

.mw-btn--outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.mw-btn--outline:hover {
  background: #FFFFFF0D;
}

/* Mapeia para o SweetAlert2 */
.swal2-styled.swal2-confirm {
  font-family: inherit;
}

.swal2-styled.swal2-cancel {
  font-family: inherit;
}

main {
  width: 90%;
  max-width: 1000px;
  margin: 120px auto;
}

.title {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.title h1 {
  font-size: 1.4rem;
  color: var(--brand);
}

.title i {
  color: var(--brand);
}

.form-group {
  width: 100%;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
}
.form-group:last-of-type {
  margin-bottom: 0;
}
.fg-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}
.fg-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}
.fg-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}
@media screen and (max-width: 1100px) {
  .fg-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media screen and (max-width: 940px) {
  .fg-3 {
    grid-template-columns: 1fr !important;
  }
}
@media screen and (max-width: 670px) {
  .fg-4,
  .fg-2 {
    grid-template-columns: 1fr !important;
  }
}

.action-wrapper {
  width: 100%;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

@media screen and (max-width: 550px) {
  .action-wrapper {
    flex-direction: column;
  }

  .action-wrapper .btn {
    width: 100% !important;
  }
}

.wallets-wrapper {
  width: 100%;
  /* max-height: calc(100vh - 480px); */
  /* overflow: auto; */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.wallets-wrapper .wallet-wrapper {
  background-color: var(--bg-0);
  display: grid;
  grid-template-columns: 45px 1fr;
  gap: 0.6rem;
  align-items: center;
  min-height: 120px;
  max-height: 120px;
  border-radius: 15px;
  padding: 1.2rem;
  position: relative;
}

.wallets-wrapper .wallet-wrapper img {
  width: 100%;
}

.wallet-wrapper .ww-actions {
  position: absolute;
  top: 8px;
  right: 12px;
  display: flex;
  gap: 0.8rem;
}

.wallet-wrapper .ww-amount {
  position: absolute;
  bottom: 8px;
  right: 12px;
}

.wallet-wrapper .ww-amount span {
  font-weight: 900;
}

.wallet-wrapper .ww-actions i {
  font-size: 20px;
}

.wallet-wrapper .ww-body {
  text-align: right;
}

.wallet-wrapper .ww-body span {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.875rem;
  opacity: 0.5;
}

@media screen and (max-width: 1000px) {
  .wallets-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 650px) {
  .wallets-wrapper {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 550px) {
  .wallets-wrapper {
    max-height: calc(100vh - 480px);
  }
}

.summary-wrapper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "title title title"
    "inc   exp   bal";
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, var(--bg-1), transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.summary-wrapper > p:first-child {
  grid-area: title;
  margin: 0 0 .25rem 0;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .02em;
}
.summary-wrapper > p:first-child b {
  color: var(--brand);
  font-weight: 900;
}

/* Cards base */
.summary-wrapper > div {
  background:
    radial-gradient(1200px 1200px at 95% -50%, #ffffff0a 0%, transparent 60%),
    linear-gradient(180deg, #ffffff08, #00000000);
  border: 1px solid var(--neutral-border);
  border-radius: 12px;
  padding: 1rem;
  min-height: 108px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  position: relative;
  overflow: hidden;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
  isolation: isolate; /* para a “glow” não vazar */
}

/* Headline do card */
.summary-wrapper > div > p {
  margin: 0;
  font-weight: 800;
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--muted);
}

/* Valor */
.summary-wrapper > div > span {
  align-self: end;
  font-weight: 900;
  font-size: 1.4rem;
  line-height: 1.1;
  letter-spacing: .01em;
  color: var(--text);
  text-shadow: 0 0 12px #00000050;
}

/* Interações */
.summary-wrapper > div:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 6px 16px #00000040, inset 0 0 0 1px #ffffff0f;
}
.summary-wrapper > div:focus-within {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring-primary);
  border-color: var(--primary);
}

/* Barrinha lateral por tipo (accent) */
.summary-wrapper > div::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 5px;
  opacity: .9;
  transform: translateZ(0);
}

/* ====== Variações por tipo ====== */
.sw-incomes { grid-area: inc; }
.sw-expenses { grid-area: exp; }
.sw-balance  { grid-area: bal; }

/* Entradas (success) */
.sw-incomes::before { background: linear-gradient(180deg, var(--success), var(--success-hover)); }
.sw-incomes > p { color: var(--success); }
.sw-incomes > span { color: #DFFBEA; text-shadow: 0 0 12px var(--success-active); }

/* Saídas (danger) */
.sw-expenses::before { background: linear-gradient(180deg, var(--danger), var(--danger-hover)); }
.sw-expenses > p { color: var(--danger); }
.sw-expenses > span { color: #FFECEC; text-shadow: 0 0 12px var(--danger-active); }

/* Saldo (brand por padrão) */
.sw-balance::before { background: linear-gradient(180deg, var(--brand), var(--brand-hover)); }
.sw-balance > p { color: var(--brand); }
.sw-balance > span { color: #F5F1FF; text-shadow: 0 0 12px var(--brand-active); }

/* Saldo negativo opcional */
.sw-balance.is-negative::before { background: linear-gradient(180deg, var(--danger), var(--danger-hover)); }
.sw-balance.is-negative > p { color: var(--danger); }
.sw-balance.is-negative > span { color: #FFECEC; text-shadow: 0 0 12px var(--danger-active); }

@media (max-width: 900px) {
  .summary-wrapper {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "inc"
      "exp"
      "bal";
  }
}

@media (prefers-reduced-motion: reduce) {
  .summary-wrapper > div {
    transition: border-color .15s ease, box-shadow .15s ease;
  }
}

.summary-wrapper.is-loading > div > span {
  position: relative;
  color: transparent;
}
.summary-wrapper.is-loading > div > span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background:
    linear-gradient(90deg, #ffffff1a 25%, #ffffff33 37%, #ffffff1a 63%);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-80%); }
  100% { transform: translateX(80%); }
}

#expense-list {
  width: 100%;
  border-collapse: collapse;
}

#expense-list tbody tr:nth-child(odd) {
  background-color: var(--bg-0);
}

#expense-list tbody tr:nth-child(even) {
  background-color: var(--bg-1);
}

#expense-list th {
  text-align: left;
  border-bottom: 1px solid var(--border);
}

#expense-list td {
  opacity: 0.6;
}

#expense-list th,
#expense-list td {
  padding: 0.55rem 0.3rem;
}

#expense-list thead tr th:nth-of-type(1),
#expense-list tbody tr td:nth-of-type(1) {
  width: 40px;
  text-align: center;
}

#expense-list thead tr th:nth-of-type(3),
#expense-list tbody tr td:nth-of-type(3) {
  width: 120px;
  text-align: center;
}

#expense-list input[type="text"] {
  background-color: transparent;
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  outline: none;
}

#expense-list tfoot {
  text-align: right;
  font-weight: 900;
  opacity: 1;
}

/* Base: evita travar a largura das colunas em telas médias */
#expense-list {
  table-layout: fixed; /* ajuda os inputs a não estourarem */
  width: 100%;
}
#expense-list th, #expense-list td { word-wrap: break-word; }

/* Em telas estreitas empilhamos as células */
@media (max-width: 700px) {
  #expense-list thead {
    /* some o cabeçalho e usamos labels nos tds */
    display: none;
  }
  #expense-list, 
  #expense-list tbody, 
  #expense-list tr, 
  #expense-list td, 
  #expense-list th {
    display: block;
    width: 100%;
  }

  #expense-list tbody tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin: .6rem 0;
    background:
      radial-gradient(800px 800px at 95% -30%, #ffffff0a 0%, transparent 60%),
      linear-gradient(180deg, var(--bg-1), var(--bg-0));
  }

  /* cada célula vira uma fileira com label + conteúdo */
  #expense-list tbody td {
    display: grid;
    grid-template-columns: 120px 1fr;  /* label | campo */
    gap: .6rem;
    align-items: center;
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
    opacity: 1; /* mantém legível no mobile */
  }
  #expense-list tbody tr td:last-child {
    border-bottom: 0;
  }

  /* label gerado via data-attribute */
  #expense-list tbody td::before {
    content: attr(data-label);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    font-weight: 800;
    align-self: start;
    line-height: 1.2;
  }

  /* primeira célula (checkbox) com grid menor */
  #expense-list tbody td[data-label="Selecionar"] {
    grid-template-columns: 120px auto;
  }

  /* inputs ocupam a coluna de conteúdo por inteiro */
  #expense-list input[type="text"] {
    width: 100%;
    min-width: 0; /* crucial pra não estourar grid */
  }

  /* remove larguras fixas definidas no desktop */
  #expense-list thead tr th:nth-of-type(1),
  #expense-list tbody tr td:nth-of-type(1),
  #expense-list thead tr th:nth-of-type(3),
  #expense-list tbody tr td:nth-of-type(3) {
    width: auto;
    text-align: left;
  }
}

/* Backdrop fixo no viewport */
.mw-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: none; /* controlado por .is-open */
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow: hidden; /* anima o dialog sem scroll saltar */
}

/* Mostra quando abre */
.mw-modal.is-open {
  display: flex;
}

/* Backdrop */
.mw-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  opacity: 0;
  transition: opacity .18s ease;
}

/* Container animável */
.mw-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;               /* md */
  border: 1px solid var(--modal-border);
  border-radius: 14px;
  background: var(--modal-bg);
  color: var(--modal-text);
  box-shadow: var(--modal-shadow);
  transform: translateY(12px) scale(.98);
  opacity: 0;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .22s ease;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Estados abertos (acionados junto do .is-open) */
.mw-modal.is-open .mw-modal__backdrop {
  opacity: 1;
}
.mw-modal.is-open .mw-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Tamanhos */
.mw-modal--sm .mw-modal__dialog { max-width: 420px; }
.mw-modal--md .mw-modal__dialog { max-width: 560px; }
.mw-modal--lg .mw-modal__dialog { max-width: 760px; }
.mw-modal--xl .mw-modal__dialog { max-width: 980px; }
.mw-modal--full .mw-modal__dialog { max-width: min(1100px, 96vw); height: min(88vh, 900px); }

/* Header / Body / Footer */
.mw-modal__header,
.mw-modal__footer {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--modal-border);
}
.mw-modal__footer { 
  border-bottom: 0;
  border-top: 1px solid var(--modal-border);
}

.mw-modal__title {
  margin: 0;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--modal-title);
  letter-spacing: .01em;
}

.mw-modal__close {
  margin-left: auto;
  border-radius: .5rem;
  background: transparent;
  color: var(--muted);
  width: 2.25rem; height: 2.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 1px solid transparent;
}
.mw-modal__close:hover { background: #FFFFFF0D; color: var(--text); }
.mw-modal__close:focus-visible { box-shadow: 0 0 0 3px var(--ring-brand); }

.mw-modal__body {
  padding: 1rem;
  overflow: auto;
  max-height: 70vh; /* confortável em telas menores */
}
.mw-modal--full .mw-modal__body { max-height: none; }

/* Conteúdo tipográfico */
.mw-modal__body p { color: var(--modal-text); opacity: .95; }
.mw-modal__body .muted { color: var(--modal-muted); }

/* Utilitários */
.mw-modal__header, .mw-modal__footer { display: flex; align-items: center; gap: .5rem; }
.mw-modal__spacer { flex: 1; }

input[type="color"] {
  height: 50px;
  padding: 0 !important;
}

.input-group-icon {
  width: 100%;
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.input-group-icon label {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text);
}

.input-group-icon img {
  max-width: 45px;
  max-height: 45px;
}

.input-group-icon .icons-wrapper {
  position: absolute;
  top: 55px;
  border-radius: 10px;
  left: 0;
  width: 220px;
  max-height: 120px;
  padding: 0.8rem;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  overflow: auto;
  background: var(--bg-1);
  border: 1px solid var(--border);
  z-index: 9999;
  justify-content: space-around;
  align-items: center;
  display: none;
}

.input-group-icon .icons-wrapper input {
  display: none;
}

.selected-icon,
.input-group-icon .icons-wrapper img {
  cursor: pointer;
}

/* ===== Mini-menu (kebab) das carteiras ===== */
.kebab-btn{
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: .6rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .06s ease;
}
.kebab-btn:hover{ background: #FFFFFF0D; color: var(--text); }
.kebab-btn:focus-visible{ outline: none; box-shadow: 0 0 0 3px var(--ring-brand); }
.kebab-btn .fa{ font-size: 18px; }

/* Container do menu */
.wallet-menu{
  position: absolute;
  top: 36px;              /* logo abaixo do botão */
  right: 6px;
  min-width: 170px;
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--neutral-border);
  border-radius: 10px;
  box-shadow: 0 12px 30px #00000055;
  padding: .4rem;
  z-index: 3000;          /* acima dos cartões */
  display: none;          /* abre via [data-open="true"] */
  transform-origin: top right;
}
.wallet-menu[data-open="true"]{
  display: block;
  animation: walletMenuIn .12s ease;
}
@keyframes walletMenuIn {
  from { transform: scale(.96); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Itens */
.wallet-menu__item{
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: .6rem;
  padding: .55rem .6rem;
  border-radius: .55rem;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.wallet-menu__item .fa{ font-size: 16px; opacity: .9; }
.wallet-menu__item:hover{ background: #FFFFFF0D; }

/* “Excluir” em vermelho do tema */
.wallet-menu__item--danger{
  color: var(--danger);
}
.wallet-menu__item--danger .fa{ color: var(--danger); }
.wallet-menu__item--danger:hover{
  background: #EF44441A;
  border-color: #EF44441A;
}

/* ===== Responsividade do mini-menu (flip) ===== */
.wallet-menu--left{
  right: auto !important;
  left: 6px !important;
  transform-origin: top left !important;
}
.wallet-menu--up{
  top: auto !important;
  bottom: 36px !important; /* acima do botão */
  transform-origin: bottom right !important;
}
.wallet-menu--left.wallet-menu--up{
  transform-origin: bottom left !important;
}

/* Menu portado para o <body> (fora do overflow) */
.wallet-menu--portal{
  position: fixed !important;
  z-index: 5000 !important;
  /* zera âncoras padrão do menu dentro do cartão */
  top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
  transform-origin: top right;
}

.wallet-header {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.wallet-header h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
}

.wallet-header span {
  font-weight: 900;
}

.subtitle {
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.subtitle span {
  font-weight: 900;
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.transactions-list .tl-item {
  border: 1px solid var(--border);
}

.transactions-list .tl-header {
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.transactions-list .tl-header span {
  font-size: 0.8rem;
  font-weight: 700;
}

.tl-expense {
  background-color: #EF444420;
}

.tl-income {
  background-color: #22C55E20;
}

.transactions-list .tl-body {
  padding: 0.4rem 0.8rem;
  text-transform: uppercase;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.transactions-list .tl-body p {
  font-weight: 900;
}

.transactions-list .tl-footer {
  padding: 0.4rem 0.8rem;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  border-top: 1px solid var(--border);
}

.transactions-summary {
  width: 100%;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.transactions-summary .ts-item {
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.transactions-summary .ts-item span {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.ts-income {
  border-left: 3px solid var(--success) !important;
  color: var(--success) !important;
}

.ts-expense {
  border-left: 3px solid var(--danger) !important;
  color: var(--danger) !important;
}

.ts-balance {
  border-left: 3px solid var(--brand) !important;
  color: var(--brand) !important;
}

.member-wrapper {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 1rem;
}

@media screen and (max-width: 950px) {
  .member-wrapper {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 820px) {
  .member-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 630px) {
  .member-wrapper {
    grid-template-columns: 1fr;
  }
}

.member-wrapper .mw-item {
  width: 100%;
  height: 50px;
}

.member-wrapper .mw-item input[type="checkbox"] {
  display: none;
}

.member-wrapper .mw-item label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

/* visual quando checked */
.member-wrapper .mw-item input[type="checkbox"]:checked + label {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ícone aparece só quando checked */
.member-wrapper .mw-item input[type="checkbox"]:checked + label::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  line-height: 1;
}