 html,
 body {
   font-family: 'Segoe UI', sans-serif;
   background-color: white;
   margin: 0;
   padding: 1rem;
 }

 /* Esconde em mobile por padrão */
 .transaction-item .detailsDate {
   display: none;
 }

 h1 {
   color: #333;
   font-size: 1.8rem;
   font-weight: 600;
 }

 h3 {
   font-size: 1rem;
   font-weight: 600;
   margin-bottom: 1rem;
   color: #222;
 }

 h4 {
   font-size: 1rem;
   font-weight: 600;
   margin-top: 1rem;
   margin-bottom: 0.5rem;
   color: #222;
 }

 .dashboard {
   max-width: 420px;
   margin: auto;
 }

 /* título comum */
 .section-title {
   margin: 1rem 0 0.5rem;
   font-size: 1rem;
   font-weight: 600;
   color: #222;
 }

 /* container padrão: coluna (mobile) */
 .bottom-section {
   margin-top: 40px;
   display: flex;
   flex-direction: column;
   gap: 1.5rem;
   padding: 0 1rem;
 }

 .chart-container {
   position: relative;
   width: 90%;
   max-width: 300px;
   height: 300px;
   margin: auto;
 }

 .chart-container canvas {
   width: 100% !important;
   height: 100% !important;
 }

 .center-value {
   position: absolute;
   top: 60%;
   left: 50%;
   transform: translate(-50%, -50%);
   font-size: 1.4rem;
   font-weight: bold;
   color: #333;
   text-align: center;
   white-space: nowrap;
 }

 /*--------------- */
 .slider-container {
   overflow-x: auto;
   white-space: nowrap;
   padding-bottom: 1rem;
 }

 .category-card {
   display: inline-block;
   width: 130px;
   height: 180px;
   padding: 1rem;
   margin-right: 1rem;
   border-radius: 20px;
   color: #000;
   background-color: #ffcccb;
   vertical-align: top;
   box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
 }

 .category-card .icon {
   font-size: 2rem;
   margin-bottom: 1rem;
 }

 .category-card .rs {
   margin-top: 2rem;
   margin-left: 0.5rem;
 }

 .category-card .value {
   font-size: 1.4rem;
   font-weight: bold;
   margin-left: 0.5rem;
 }

 .category-card .label {
   font-size: 0.75rem;
   text-transform: uppercase;
   font-weight: 600;
   margin-top: 0.5rem;
   margin-left: 0.5rem;
 }

 /*--------------- */


 .filters {
   margin-top: 2rem;
   display: flex;
   flex-wrap: wrap;
   gap: 1rem;
   justify-content: center;
 }

 .filters input,
 .filters select {
   padding: 0.5rem;
   border-radius: 4px;
   border: 1px solid #ccc;
   font-size: 1rem;
   flex: 1 1 150px;
 }

 .filters button {
   padding: 0.5rem 1rem;
   font-size: 0.95rem;
   display: flex;
   align-items: center;
   gap: 0.5rem;
   border: none;
   border-radius: 6px;
   cursor: pointer;
   transition: background-color 0.2s ease;
 }

 .filters button:nth-of-type(1) {
   background-color: #009879;
   color: white;
 }

 .filters button:nth-of-type(1):hover {
   background-color: #007c63;
 }

 .filters button:nth-of-type(2) {
   background-color: #e53935;
   color: white;
 }

 .filters button:nth-of-type(2):hover {
   background-color: #b71c1c;
 }

 .export-group {
   display: flex;
   justify-content: center;
   gap: 0.5rem;
   flex-wrap: wrap;
   margin-top: 1rem;
 }

 .export-group button {
   padding: 0.5rem 0.8rem;
   font-size: 0.9rem;
   border: none;
   border-radius: 6px;
   cursor: pointer;
   transition: background-color 0.2s ease;
   color: white;
   display: flex;
   align-items: center;
   gap: 0.5rem;
 }

 .export-group button:nth-child(1) {
   background-color: #009879;
 }

 .export-group button:nth-child(2) {
   background-color: #4caf50;
 }

 .export-group button:nth-child(3) {
   background-color: #e53935;
 }

 .export-group button:hover {
   opacity: 0.9;
 }

 .transaction-list {
   display: flex;
   flex-direction: column;
   gap: 1rem;
   /* espaçamento nas laterais */
   padding: 0.5rem 0;
   max-height: 500px;
   overflow-y: auto;
   overflow-x: hidden;
 }


 .transaction-item:hover {
   transform: scale(1.015);
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
 }

 .transaction-item {
   background: #fff;
   border-radius: 10px;
   padding: 0.75rem 1rem;
   display: flex;
   align-items: center;
   justify-content: space-between;
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
   transition: all 0.3s ease;
   animation: fadeIn 0.4s ease;
   transition: transform 0.25s ease, box-shadow 0.25s ease;
   margin: 0rem 1rem 0rem 1rem;
   cursor: pointer;
 }

 @keyframes fadeIn {
   from {
     opacity: 0;
     transform: translateY(8px);
   }

   to {
     opacity: 1;
     transform: translateY(0);
   }
 }

 .transaction-item .icon {
   width: 36px;
   height: 36px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   margin-right: 1rem;
   color: white;
   font-size: 1rem;
 }

 .tipo-Mercado .icon {
   background-color: #4caf50;
 }

 .tipo-Diversão .icon {
   background-color: #f06292;
 }

 .tipo-Comida .icon {
   background-color: #ffa726;
 }

 .tipo-Educação .icon {
   background-color: #42a5f5;
 }

 .tipo-Assinatura .icon {
   background-color: #7e57c2;
 }

 .tipo-Transporte .icon {
   background-color: #ef5350;
 }

 .tipo-Saúde .icon {
   background-color: #26a69a;
 }

 .transaction-item .details {
   flex: 1;
   display: flex;
   flex-direction: column;
 }



 .transaction-item .details strong {
   font-size: 1rem;
   color: #333;
 }


 .transaction-item .gastosDate {
   font-size: 0.70rem;
   color: #888;
 }

 .transaction-item .categoria {
   font-size: 0.85rem;
   color: #888;
 }

 .transaction-item .valor {
   font-weight: bold;
   font-size: 1rem;
 }

 .valor-positivo {
   color: #2e7d32;
 }

 .valor-negativo {
   color: #c62828;
 }

 .filter-icon {
   position: absolute;
   top: 20px;
   right: 30px;
   background: #009879;
   color: white;
   padding: 10px;
   border-radius: 50%;
   cursor: pointer;
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
   z-index: 1000;
 }

 .filter-icon:hover {
   background: #007a63;
 }


 .modal-ios {
   position: fixed;
   inset: 0;
   background-color: rgba(0, 0, 0, 0.8);
   z-index: 999;
   display: flex;
   align-items: flex-end;
   justify-content: center;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.3s ease;
   overflow-x: hidden;
 }

 .modal-ios.show {
   opacity: 1;
   visibility: visible;
 }

 .modal-ios.show .modal-ios-content {
   transform: translateY(0%);
 }

 .modal-ios-content {
   overflow-x: hidden;
   /* Impede o scroll lateral */
   max-width: 100vw;
   /* Garante que nada passe da largura da tela */
   box-sizing: border-box;
 }

 .modal-handle {
   width: 40px;
   height: 5px;
   background: #ccc;
   border-radius: 5px;
   margin: 0 auto 1rem auto;
 }

 /* Novo modal de detalhes */
 .modal-detalhes {
   position: fixed;
   inset: 0;
   background-color: rgba(0, 0, 0, 0.8);
   z-index: 999;
   display: none;
   align-items: flex-end;
   justify-content: center;
 }

 .modal-detalhes.show {
   display: flex;
 }

 .modal-detalhes .modal-ios-content {
   background: #ffffff;
   width: 100%;
   border-top-left-radius: 18px;
   border-top-right-radius: 18px;
   animation: slideUp 0.3s ease forwards;
   height: 20%;
 }

 .detalhes-conteudo {
   text-align: center;
   background: white;
   border-bottom-left-radius: 18px;
   border-bottom-right-radius: 18px;
   padding: 1rem;
 }

 .detalhes-icon {
   font-size: 1.3rem;
   width: 42px;
   height: 42px;
   border-radius: 50%;
   background-color: rgba(255, 255, 255, 0.2);
   display: flex;
   align-items: center;
   justify-content: center;
   color: white;
 }

 .detalhes-nome {
   font-size: 1rem;
   font-weight: bold;
   color: white;
 }

 .detalhes-categoria,
 .detalhes-valor,
 .detalhes-data {
   font-size: 0.95rem;
   color: #444;
   margin-bottom: 0.4rem;
 }

 .detalhes-icon.tipo-Mercado {
   background-color: #4caf50;
 }

 .detalhes-icon.tipo-Diversão {
   background-color: #f06292;
 }

 .detalhes-icon.tipo-Comida {
   background-color: #ffa726;
 }

 .detalhes-icon.tipo-Educação {
   background-color: #42a5f5;
 }

 .detalhes-icon.tipo-Assinatura {
   background-color: #7e57c2;
 }

 .detalhes-icon.tipo-Transporte {
   background-color: #ef5350;
 }

 .detalhes-icon.tipo-Saúde {
   background-color: #26a69a;
 }

 @keyframes slideUp {
   from {
     transform: translateY(100%);
   }

   to {
     transform: translateY(0);
   }
 }

 .empty-state-wrapper {
   position: fixed;
   top: 0;
   left: 0;
   width: 100vw;
   height: 100vh;
   /* continua assim */
   display: flex;
   justify-content: center;
   align-items: center;
   background-color: white;
   z-index: 999;
   padding: 1rem;
 }

 .empty-state {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);

   display: flex;
   flex-direction: column;
   align-items: center;
   text-align: center;
   max-width: 400px;
   width: 100%;
 }

 .empty-state img {
   width: 160px;
   margin-bottom: 1.5rem;
   opacity: 0.95;
 }

 .empty-state h2 {
   font-size: 1.4rem;
   font-weight: 600;
   margin-bottom: 0.5rem;
   color: #222;
 }

 .empty-state p {
   font-size: 0.95rem;
   margin-bottom: 1.2rem;
   color: #666;
   max-width: 320px;
 }

 .empty-state button {
   background-color: #009879;
   color: white;
   border: none;
   padding: 0.6rem 1.2rem;
   font-size: 0.95rem;
   border-radius: 10px;
   box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
   transition: background-color 0.2s ease;
   cursor: pointer;
   display: flex;
   align-items: center;
   gap: 0.5rem;
 }

 .empty-state button:hover {
   background-color: #007c63;
 }


 .modal .categoria-tag {
   display: inline-block;
   background-color: #f0f0f0;
   color: #444;
   padding: 0.3rem 0.8rem;
   border-radius: 999px;
   font-size: 0.75rem;
   font-weight: bold;
   margin-top: 0.8rem;
 }

 .header-conteudo {
   display: flex;
   align-items: center;
   gap: 0.7rem;
   padding: 0 1rem;
   /* Mantém espaçamento horizontal interno apenas no conteúdo */
   width: 100%;
 }

 .modal-header-color {
   background-color: #ccc;
   padding: 1rem 0;
   /* Remove padding lateral */
   border-radius: 0;
   display: flex;
   flex-direction: column;
   align-items: flex-start;
   position: relative;
   width: 100%;
   border-top-left-radius: 18px;
   border-top-right-radius: 18px;
 }

 .valor {
   font-size: 1.5rem;
   font-weight: bold;
   margin-bottom: 0.3rem;
 }

 .data {
   font-size: 0.9rem;
   color: #555;
 }

 #modalCategoriaTag {
   padding: 0.3rem 0.8rem;
   font-size: 0.75rem;
   font-weight: bold;
   border-radius: 12px;
   background-color: white;
   color: #444;
   position: absolute;
   top: 10px;
   right: 12px;
 }

 #modalCategoriaTotal {
   padding: 0.3rem 0.8rem;
   font-size: 0.75rem;
   font-weight: bold;
   border-radius: 12px;
   background-color: white;
   color: #444;
   position: absolute;
   top: 10px;
   right: 12px;
 }

 .modal-filtros-content {
   background: #ffffff;
   width: 100%;
   border-top-left-radius: 18px;
   border-top-right-radius: 18px;
   padding: 1rem;
   transform: translateY(100%);
   transition: transform 0.3s ease;
 }

 .modal-ios.show .modal-filtros-content {
   transform: translateY(0%);
 }

 .badge {
   background-color: #009879;
   color: white;
   font-size: 0.75rem;
   padding: 0.2rem 0.6rem;
   border-radius: 1rem;
   margin-left: 0.5rem;
 }


 .gasto-item {
   background: #f9f9f9;
   border-radius: 12px;
   padding: 0.8rem 1rem;
   margin-bottom: 0.6rem;
   box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
   display: flex;
   justify-content: space-between;
   align-items: center;
 }

 .gasto-item .info {
   display: flex;
   flex-direction: column;
 }

 .gasto-item .info .nome {
   font-weight: 600;
   font-size: 0.95rem;
   color: #333;
 }

 .gasto-item .info .data {
   font-size: 0.75rem;
   color: #888;
 }

 .gasto-item .valor {
   font-weight: bold;
   font-size: 1rem;
 }

 .gasto-item .valor.positivo {
   color: #2e7d32;
 }

 .gasto-item .valor.negativo {
   color: #c62828;
 }

 .modal-categoria-content {
   background: #ffffff;
   width: 100%;
   border-top-left-radius: 18px;
   border-top-right-radius: 18px;
   transform: translateY(100%);
   transition: transform 0.3s ease;
   max-height: 90vh;
   overflow-y: auto;
   padding-bottom: 2rem;
 }

 .modal-ios.show .modal-categoria-content {
   transform: translateY(0%);
 }

 .data-header {
   font-weight: bold;
   font-size: 0.85rem;
   color: #666;
   margin: 1rem 0 0.3rem 0.5rem;
   position: relative;
   padding-bottom: 0.3rem;
 }

 .data-hora {
   font-size: 0.75rem;
   color: #999;
   margin-top: 0.2rem;
 }

 .linha-separadora {
   width: 100%;
   height: 1px;
   background-color: #eee;
   margin: 1rem 0;
 }

 /* Por padrão (mobile), mostre só o slider e esconda o listão desktop */
 .mobile-only {
   display: block;
 }

 .desktop-only {
   display: none;
 }


 @media (min-width: 768px) {

   html,
   body {
     font-family: 'Segoe UI', sans-serif;
     background-color: #f1f0f5;
     margin: 0;
     padding: 1rem;
   }

   .dashboard {
     max-width: 1400px;
     margin: 0 auto;
     padding: 1rem 2rem;
   }


   .transaction-wrapper {
     background: #fff;
     border-radius: 8px;
     padding: 1rem;
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
   }

   .grafico-e-categorias {
     display: flex;
     justify-content: center;
     /* centraliza o chart-container */
     align-items: center;
     /* alinha verticalmente */
     margin-bottom: 2rem;
   }

   .chart-container {
     margin: 0 auto;
   }

   .center-value {
     position: absolute;
     top: 60%;
     left: 50%;
     transform: translate(-50%, -50%);
     font-size: 1.4rem;
     font-weight: bold;
     color: #333;
     text-align: center;
     white-space: nowrap;
   }

   .categoria-container {
     flex: 1;
   }

   .slider-container {
     display: flex;
     flex-wrap: wrap;
     gap: 1rem;
   }

 }

 /* A partir de 1024px (desktop), inverta: esconda o slider e mostre o listão */
 @media (min-width: 1024px) {

   .grafico-e-categorias {
     justify-content: center;
   }

   .transaction-item .detailsDate {
     display: block;
     flex: 1;
     display: flex;
     flex-direction: column;
   }


   /* Container geral passa a ficar em linha no desktop */
   .bottom-section {
     display: flex;
     flex-direction: row;
     align-items: flex-start;
     gap: 2rem;
   }

   /* Oculta o slider mobile e exibe o listão desktop */
   .mobile-only {
     display: none;
   }

   .desktop-only {
     display: block;
   }

   .categoria-container {
     display: none;
   }

   /* Ajusta cada bloco para ocupar metade do espaço */
   .transaction-wrapper {
     flex: 1 1 0;
     max-width: 800px;
   }

   /* Gastos mantêm padding e fonte originais */
   .bottom-section .transaction-wrapper:nth-child(2) .transaction-item {
     padding: 1rem;
     font-size: 1rem;
     cursor: default;
     pointer-events: none;
   }

   /* Categorias vira um grid de 2 colunas */
   .bottom-section .transaction-wrapper:nth-child(1) .transaction-list {
     display: flex;
   }

   /* Ícone menor e com espaçamento reduzido */
   .bottom-section .transaction-wrapper:nth-child(2) .transaction-item .icon {
     font-size: 1.2rem;
     margin-right: 0.5rem;
   }

   /* Valor alinhado à direita e fonte reduzida */
   .bottom-section .transaction-wrapper:nth-child(2) .transaction-item .valor {
     margin-left: auto;
     font-size: 0.85rem;
     font-weight: 500;
   }

   /* Valor alinhado à direita e fonte reduzida */
   .bottom-section .transaction-wrapper:nth-child(1) .transaction-item .valor {
     margin-left: auto;
     font-size: 0.85rem;
     font-weight: 500;
   }

   /* apenas o modal-ios (filtros e categoria) vira popup central */
   .modal-ios {
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 0 1rem;
   }

   .modal-ios .modal-ios-content,
   .modal-ios .modal-filtros-content {
     width: 600px;
     max-width: 90vw;
     border-radius: 20px;
     background: #fff;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
     transform: none !important;
     transition: none !important;
     margin: 0;
   }

   .modal-handle {
     display: none;
   }

   /* o modal-detalhes permanece escondido até ganhar a classe .show */
   .modal-detalhes {
     display: none;
   }

   .modal-detalhes.show {
     display: flex;
     align-items: center;
     justify-content: center;
   }

   .modal-detalhes.show .modal-ios-content {
     width: 600px;
     max-width: 90vw;
     border-radius: 20px;
     background: #fff;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
     transform: none !important;
     transition: none !important;
     margin: 0;
   }


 }


 /* mobile: esconde o segundo .transaction-wrapper (categorias desktop) */
 @media (max-width: 1023px) {
   body {
     padding: 0.5rem;
   }

   .bottom-section .transaction-wrapper:nth-child(1) {
     display: none;
   }

   .transaction-list {
     padding: 0;
   }

   .transaction-item {
     /* elimina a margem lateral antiga */
     margin: 0.5rem 0;
     /* faz o card ocupar toda a largura possível, descontando o padding da <body> */
     width: calc(100% - 2rem);
   }

 }