:root {
  color-scheme: dark;
  --background: #0b0f17;
  --surface: #131a26;
  --border: #242e3e;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --green: #4ade80;
  --red: #fb7185;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 36px 24px;
  border-right: 1px solid var(--border);
  background: #0e1420;
}

.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand span {
  color: var(--green);
}

nav {
  display: grid;
  gap: 10px;
  margin-top: 48px;
}

.nav-link {
  padding: 14px 16px;
  border-radius: 10px;
  color: var(--muted);
}

.nav-link:hover,
.nav-link.active {
  background: #1b2b27;
  color: var(--green);
}

.sidebar-note {
  margin-top: auto;
  padding-top: 40px;
  font-size: 13px;
  color: var(--muted);
}

main {
  width: 100%;
  max-width: 1300px;
  margin-inline: auto;
  padding: 48px;
}

.page-header,
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}

h1 {
  margin: 10px 0;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -1px;
}

.subtitle,
.card p,
.card span,
.demo-note {
  color: var(--muted);
}

.button {
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.button:hover {
  background: #202b3d;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 36px 0;
}

.card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.card p {
  margin: 0;
  font-size: 14px;
}

.card h2 {
  margin: 20px 0 12px;
  font-size: clamp(24px, 2.5vw, 32px);
}

.card span {
  font-size: 12px;
}

.balance {
  background: linear-gradient(135deg, #17382b, #131a26);
  border-color: #28503e;
}

.income {
  color: var(--green);
}

.expense {
  color: var(--red);
}

.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.panel-header {
  padding: 24px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.badge {
  padding: 6px 10px;
  border-radius: 6px;
  background: #243047;
  color: #bac9e4;
  font-size: 12px;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.text-right {
  text-align: right;
}

.tag {
  font-size: 12px;
  font-weight: 600;
}

.demo-note {
  margin-top: 20px;
  font-size: 12px;
}

@media (max-width: 1000px) {
  main {
    padding: 32px 24px;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
  }

  .sidebar-note {
    display: none;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
.transaction-panel {
  margin-top: 32px;
}

.transaction-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 0 24px 24px;
}

.transaction-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.transaction-form input,
.transaction-form select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

.transaction-form input:focus-visible,
.transaction-form select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.button-primary {
  align-self: end;
  background: var(--green);
  color: #0b0f17;
  font-weight: 700;
}

.button-primary:hover {
  background: #86efac;
}

.form-message {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 700px) {
  .transaction-form {
    grid-template-columns: 1fr;
  }
}
/* Layout mais compacto */
main {
  max-width: 1150px;
  padding: 32px;
}

.cards {
  gap: 14px;
  margin: 24px 0;
}

.card {
  padding: 20px;
}

.card h2 {
  margin: 12px 0 8px;
  font-size: clamp(22px, 2.5vw, 28px);
}

.panel-header {
  padding: 18px 20px;
}

th,
td {
  padding: 14px 20px;
}

/* Botões de entrada e saída */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-income {
  background: #17382b;
  border-color: #28503e;
  color: var(--green);
}

.button-income:hover {
  background: #214b38;
}

.button-expense {
  background: #3b1e29;
  border-color: #643042;
  color: var(--red);
}

.button-expense:hover {
  background: #512737;
}

/* Formulário */
dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
}

dialog::backdrop {
  background: rgb(0 0 0 / 65%);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-button {
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

#transaction-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

#transaction-form input {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

#transaction-form input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

@media (max-width: 700px) {
  main {
    padding: 24px 16px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}
.action-column,
.transaction-action {
  width: 80px;
  text-align: center;
}

.cancel-transaction-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.cancel-transaction-button:hover {
  color: var(--red);
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.5);
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.18);
}

#cancel-transaction-dialog {
  width: min(420px, calc(100% - 32px));
  margin: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

#cancel-transaction-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.confirmation-content h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
  text-align: center;
}

.confirmation-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.confirmation-actions .button {
  min-width: 100px;
  background: var(--background);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.confirm-yes:hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--background);
}

.confirm-no:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--background);
}
/* Cadastro de categorias */
.category-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

#transaction-form .category-label-row label {
  margin-bottom: 0;
}

.category-create-button {
  padding: 4px 0;
  border: none;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.category-create-button:hover {
  text-decoration: underline;
}

#create-category-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

#create-category-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

#create-category-form input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.category-message {
  margin: 10px 0 18px;
  color: var(--red);
  font-size: 13px;
}

.category-message:empty {
  display: none;
}

.category-confirmation-message {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
  overflow-wrap: anywhere;
}
/* Garante que somente a página selecionada apareça. */
.page-section[hidden] {
  display: none !important;
}

.nav-link.active {
  background-color: #161b22;
  color: #2a3340;
  font-weight: 600;
}

/* Resumo financeiro */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.summary-card,
.placeholder-card {
  padding: 24px;
  background-color: #161b22;
  border: 1px solid #2a3340;
  border-radius: 16px;
}

.summary-card h2 {
  margin: 0 0 12px;
  color: #6b7280;
  font-size: 15px;
  font-weight: 500;
}

.summary-value {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.income-value {
  color: #16a34a;
}

.expense-value {
  color: #dc2626;
}

/* Movimentações */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-toolbar h2 {
  margin: 0;
  font-size: 20px;
}

.transaction-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.table-container {
  overflow-x: auto;
  background-color: #161b22;
  border: 1px solid #2a3340;
  border-radius: 16px;
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.transactions-table th {
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
}

.transactions-table tbody tr:last-child td {
  border-bottom: none;
}

.transactions-table .text-right {
  text-align: right;
}

/* Páginas que serão implementadas depois */
.placeholder-card h2 {
  margin: 0 0 12px;
}

.placeholder-card p {
  margin: 0;
  color: #6b7280;
  line-height: 1.6;
}

/* Responsividade */
@media (max-width: 768px) {
  .summary-cards {
    grid-template-columns: 1fr;
  }

  .section-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* Aba selecionada: fundo verde e texto branco */
.nav-link.active {
  background-color: #16a34a;
  color: #ffffff;
}

/* Demais abas: texto verde */
.nav-link:not(.active) {
  color: #22c55e;
}

/* Destaque ao passar o mouse */
.nav-link:not(.active):hover {
  background-color: rgba(34, 197, 94, 0.12);
}
#categorias .categories-panel {
  padding: 24px;
  background-color: #161b22;
  border: 1px solid #2b3442;
  border-radius: 16px;
}

#categorias .categories-panel h2 {
  margin: 0 0 8px;
  color: #f1f5f9;
  font-size: 22px;
}

#categorias .categories-panel p {
  margin: 0 0 24px;
  color: #94a3b8;
}

#categorias .categories-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#categorias .category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background-color: #1f2630;
  border: 1px solid #303a48;
  border-radius: 10px;
  color: #f1f5f9;
}

#categorias .category-type {
  padding: 5px 10px;
  border-radius: 999px;
  background-color: #303a48;
  color: #cbd5e1;
  font-size: 12px;
  white-space: nowrap;
}

#categorias .category-income {
  background-color: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

#categorias .category-expense {
  background-color: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

@media (max-width: 640px) {
  #categorias .categories-list {
    grid-template-columns: 1fr;
  }
}
#categorias .category-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

#categorias .category-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
/* Divisórias suaves na tabela de movimentações */
.transactions-table th,
.transactions-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Remove a divisória depois da última movimentação */
.transactions-table tbody tr:last-child td {
  border-bottom: none;
}
/* Visão geral: gráficos e resumo financeiro */
#dashboard .summary-cards {
  margin-top: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  margin-top: 20px;
}

.dashboard-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #161b22;
}

.dashboard-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.dashboard-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-chart {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.chart-item-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
}

.chart-item-heading > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chart-item-value {
  flex-shrink: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chart-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #242e3e;
}

.chart-fill {
  height: 100%;
  border-radius: inherit;
}

.chart-fill-income {
  background: var(--green);
}

.chart-fill-expense {
  background: var(--red);
}

.dashboard-report {
  margin-top: 20px;
}

.dashboard-message {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

#financial-report {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.report-highlight {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dashboard-panel {
    padding: 18px;
  }

  .chart-item-heading {
    flex-wrap: wrap;
    gap: 6px;
  }
}
/* Gráficos da visão geral */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.chart-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.chart-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.chart-description {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.category-chart {
  display: grid;
  justify-items: center;
  gap: 24px;
}

.pie-chart {
  width: min(100%, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--background);
}

.chart-legend {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.chart-color {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--slice-color);
}

.chart-category-name {
  overflow-wrap: anywhere;
}

.chart-category-value {
  color: var(--muted);
  text-align: right;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 230px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
}
/* Calendário financeiro */
.calendar-panel {
  margin-top: 24px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.calendar-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-navigation .button {
  padding: 6px 14px;
  font-size: 24px;
}

#calendar-month {
  min-width: 150px;
  text-align: center;
  text-transform: capitalize;
  font-size: 14px;
  font-weight: 600;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--background);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.calendar-day:hover {
  background: #202b3d;
}

.calendar-day.is-today {
  border-color: var(--green);
}

.calendar-day.is-selected {
  background: #17382b;
  border-color: var(--green);
  color: var(--green);
}

.calendar-indicators {
  display: flex;
  justify-content: center;
  gap: 5px;
  min-height: 7px;
}

.calendar-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.income-dot {
  background: var(--green);
}

.expense-dot {
  background: var(--red);
}

.calendar-key {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.calendar-key .expense-dot {
  margin-left: 12px;
}

.calendar-details {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.calendar-details h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

.calendar-transaction {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.calendar-transaction > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.calendar-transaction strong {
  font-size: 14px;
}

.calendar-transaction-category {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-transaction-value {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
}

#calendar-undated:not(:empty) {
  margin-top: 20px;
}

@media (max-width: 480px) {
  .calendar-navigation {
    justify-content: space-between;
    width: 100%;
    gap: 6px;
  }

  #calendar-month {
    min-width: 0;
  }

  .calendar-days,
  .calendar-weekdays {
    gap: 4px;
  }

  .calendar-day {
    min-height: 48px;
    border-radius: 8px;
    font-size: 13px;
  }

  .calendar-transaction {
    flex-wrap: wrap;
    gap: 8px;
  }
}
.calendar-navigation #calendar-today {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  background: #17382b;
  border-color: #28503e;
}

.calendar-navigation #calendar-today:hover {
  background: #214b38;
}
/* Menu recolhível */
#main-content {
  min-width: 0;
}

.menu-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
}

.menu-toggle > span:first-child {
  font-size: 20px;
  line-height: 1;
}

.mobile-brand,
.sidebar-close,
.sidebar-overlay {
  display: none;
}

.app.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.app.sidebar-collapsed .sidebar {
  display: none;
}

/* Celular e tablet */
@media (max-width: 768px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    min-height: 100dvh;
  }

  #main-content {
    padding: 16px;
  }

  .menu-toolbar {
    margin-bottom: 24px;
  }

  .mobile-brand {
    display: inline-block;
    font-size: 25px;
  }

  .app .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1001;
    display: flex;
    width: min(280px, 85vw);
    height: 100dvh;
    padding: 28px 20px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    border-bottom: none;
    background: #0e1420;
    box-shadow: 12px 0 40px rgb(0 0 0 / 35%);
    transform: translateX(-100%);
    visibility: hidden;
    transition:
      transform 0.2s ease,
      visibility 0.2s ease;
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar nav {
    display: grid;
    gap: 10px;
    margin-top: 32px;
  }

  .sidebar .nav-link {
    display: block;
    padding: 14px 16px;
  }

  .sidebar-note {
    display: block;
  }

  .sidebar-close {
    position: absolute;
    top: 18px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
  }

  .sidebar-overlay:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: rgb(0 0 0 / 60%);
    cursor: pointer;
  }

  body.menu-open {
    overflow: hidden;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
  }

  /* Saldo em cima; entradas e saídas lado a lado */
  #dashboard .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
  }

  .summary-card {
    min-width: 0;
    padding: 18px 14px;
  }

  .summary-card:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #17382b, #161b22);
    border-color: #28503e;
  }

  .summary-card h2 {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
  }

  .summary-value {
    font-size: clamp(16px, 4.6vw, 24px);
    overflow-wrap: normal;
  }

  .summary-card:first-child .summary-value {
    font-size: 30px;
  }

  .dashboard-charts {
    gap: 16px;
    margin-top: 16px;
  }

  .chart-card,
  .dashboard-panel {
    padding: 18px;
  }

  .chart-card h2 {
    font-size: 17px;
  }

  .chart-description {
    margin-bottom: 20px;
    font-size: 13px;
  }

  .pie-chart {
    width: min(100%, 190px);
  }

  .chart-legend-item {
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 8px;
  }

  .chart-category-value {
    grid-column: 2;
    text-align: left;
  }

  .calendar-panel {
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app .sidebar {
    transition: none;
  }
}
/* Movimentações em cartões apenas no celular */
@media (max-width: 768px) {
  .table-container {
    overflow: visible;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  .transactions-table {
    display: block;
    white-space: normal;
  }

  .transactions-table thead {
    display: none;
  }

  .transactions-table tbody {
    display: grid;
    gap: 12px;
  }

  .transactions-table tbody tr {
    display: block;
    min-width: 0;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #161b22;
  }

  .transactions-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 10px 0;
    border-top: none;
    border-bottom: 1px solid rgb(255 255 255 / 6%);
    font-size: 14px;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .transactions-table tbody td::before {
    content: attr(data-label);
    flex-shrink: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
  }

  .transactions-table tbody td:last-child {
    border-bottom: none;
  }

  .transactions-table tbody td.money {
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .transactions-table tbody td.transaction-action {
    width: 100%;
  }

  .transactions-table .cancel-transaction-button {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
  }
}
#category-type-field[hidden] {
  display: none;
}

#category-type-field {
  margin-bottom: 18px;
}

#create-category-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

#create-category-form select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

#categorias .section-toolbar > div {
  min-width: 0;
}

#categorias .section-toolbar p {
  margin-bottom: 0;
}

#add-category {
  flex-shrink: 0;
}
#create-category-form .dialog-actions {
  margin-top: 20px;
}
.midas-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  color: #a8b3c5;
  font-size: 14px;
  cursor: pointer;
}

.midas-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #38e886;
}
/* Mantém as divisórias internas em todos os cartões no celular. */
@media (max-width: 768px) {
  .transactions-table tbody tr > td:not(:last-child),
  .transactions-table tbody tr:last-child > td:not(:last-child) {
    border-bottom: 1px solid rgb(255 255 255 / 6%);
  }
}
