* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: #1a1b29;
  color: #fff;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 25px;
}

h1 {
  text-align: center;
  color: #fff;
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.card {
  background: #252640;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.1);
  min-width: 0;
  min-height: 420px;
}

.card h3 {
  color: #fff;
  margin-bottom: 15px;
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  padding-right: 60px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.valores-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  position: relative;
}

.valor {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  letter-spacing: -0.3px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  padding: 0 6px;
}

.valor-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.valores-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin: 0 8px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.valores-separator i {
  font-size: 14px;
  color: #ffffff;
  opacity: 0.9;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.valores-separator:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(180deg);
}

.valor span:last-child {
  display: flex;
  align-items: baseline;
}

.valor span:last-child::before {
  content: 'R$';
  font-size: 14px;
  margin-right: 5px;
  opacity: 0.8;
}

.category-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  opacity: 0.9;
  padding: 15px;
  border-radius: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

.card[data-category="PAULA"] {
  background: linear-gradient(135deg, rgba(255,107,107,0.15) 0%, rgba(37,38,64,0.95) 100%);
  box-shadow: 0 8px 32px rgba(255,107,107,0.2);
  border: 1px solid rgba(255,107,107,0.3);
}

.card[data-category="PENSAO"] {
  background: linear-gradient(135deg, rgba(150,206,180,0.15) 0%, rgba(37,38,64,0.95) 100%);
  box-shadow: 0 8px 32px rgba(150,206,180,0.2);
  border: 1px solid rgba(150,206,180,0.3);
}

.card[data-category="CASA"] {
  background: linear-gradient(135deg, rgba(168,230,207,0.15) 0%, rgba(37,38,64,0.95) 100%);
  box-shadow: 0 8px 32px rgba(168,230,207,0.2);
  border: 1px solid rgba(168,230,207,0.3);
}

.card[data-category="GASTOS_NA_PRAIA"] {
  background: linear-gradient(135deg, rgba(254,195,166,0.15) 0%, rgba(37,38,64,0.95) 100%);
  box-shadow: 0 8px 32px rgba(254,195,166,0.2);
  border: 1px solid rgba(254,195,166,0.3);
}

.card[data-category="DESPEZAS_COM_CARRO"] {
  background: linear-gradient(135deg, rgba(255,217,61,0.15) 0%, rgba(37,38,64,0.95) 100%);
  box-shadow: 0 8px 32px rgba(255,217,61,0.2);
  border: 1px solid rgba(255,217,61,0.3);
}

.card[data-category="THEO"] {
  background: linear-gradient(135deg, rgba(78,205,196,0.15) 0%, rgba(37,38,64,0.95) 100%);
  box-shadow: 0 8px 32px rgba(78,205,196,0.2);
  border: 1px solid rgba(78,205,196,0.3);
}

.card[data-category="GASTOS_DESNECESSARIOS"] {
  background: linear-gradient(135deg, rgba(255,154,158,0.15) 0%, rgba(37,38,64,0.95) 100%);
  box-shadow: 0 8px 32px rgba(255,154,158,0.2);
  border: 1px solid rgba(255,154,158,0.3);
}

.card[data-category="LORIVAL"] {
  background: linear-gradient(135deg, rgba(108,92,231,0.15) 0%, rgba(37,38,64,0.95) 100%);
  box-shadow: 0 8px 32px rgba(108,92,231,0.2);
  border: 1px solid rgba(108,92,231,0.3);
}

.card:hover {
  transform: none;
  box-shadow: none;
}

.card[data-category="PAULA"]:hover { box-shadow: none; }
.card[data-category="PENSAO"]:hover { box-shadow: none; }
.card[data-category="CASA"]:hover { box-shadow: none; }
.card[data-category="GASTOS_NA_PRAIA"]:hover { box-shadow: none; }
.card[data-category="DESPEZAS_COM_CARRO"]:hover { box-shadow: none; }
.card[data-category="THEO"]:hover { box-shadow: none; }
.card[data-category="GASTOS_DESNECESSARIOS"]:hover { box-shadow: none; }
.card[data-category="LORIVAL"]:hover { box-shadow: none; }

.month-comparison {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  overflow: hidden;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}

.month-header span {
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.month-total, 
.month-difference {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  gap: 10px;
}

.month-total span:first-child,
.month-difference span:first-child {
  color: rgba(255, 255, 255, 0.7);
  flex: 0 0 auto;
  font-size: 13px;
}

.month-total span:last-child,
.month-difference span:last-child {
  text-align: right;
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.comparison-summary {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  overflow: hidden;
}

.comparison-header {
  margin-bottom: 15px;
  font-size: clamp(13px, 1.8vw, 15px);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comparison-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.comparison-value.increase {
  color: #4caf50;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.comparison-value.decrease {
  color: #f44336;
  text-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

.comparison-value i {
  font-size: 16px;
}

.comparison-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.comparison-details > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comparison-details span:first-child {
  color: #8c8c9a;
}

.comparison-details .increase {
  color: #4caf50;
}

.comparison-details .decrease {
  color: #f44336;
}

.detail-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  margin-top: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
}

.detail-date {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-description {
  color: #fff;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: clamp(14px, 2vw, 16px);
  letter-spacing: 0.3px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
  line-height: 1.5;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
  max-width: 100%;
}

.detail-value {
  color: #4c49ea;
  font-weight: 700;
  font-size: clamp(15px, 2vw, 17px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-shadow: 0 1px 2px rgba(76, 73, 234, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-value::before {
  content: 'Valor:';
  font-size: 13px;
  color: #8c8c9a;
  font-weight: normal;
}

.details {
  margin-top: 0;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.details::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.details::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}

.details::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.details::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.subtitle {
  font-size: 14px;
  color: #8c8c9a;
  margin-bottom: 20px;
}

.chart-container {
  position: relative;
  height: 200px;
  margin-top: 20px;
}

.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4c49ea;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(76, 73, 234, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 15px rgba(76, 73, 234, 0.4);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
}

.modal-content {
  width: 95%;
  max-width: 500px;
  padding: 25px;
  margin: 20px auto;
  background: #252640;
  border-radius: 15px;
  color: #fff;
}

.modal-content h2 {
  font-size: 24px;
  margin-bottom: 25px;
  color: #fff;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #8c8c9a;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px;
  border: 2px solid #363756;
  border-radius: 10px;
  background: #1a1b29;
  color: #fff;
  font-size: 16px;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4c49ea;
}

.buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

button[type="submit"] {
  background: #4c49ea;
  color: white;
}

button[type="button"] {
  background: #363756;
  color: #fff;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 73, 234, 0.2);
}

.filter-container {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.month-filter {
  background: #252640;
  border-radius: 15px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
}

.month-nav {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.month-nav:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(0);
  box-shadow: none;
}

.current-month {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  min-width: 180px;
  text-align: center;
  text-transform: capitalize;
}

@media screen and (max-width: 480px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .card {
    min-height: 380px;
  }
  
  .card h3 {
    font-size: 14px;
    padding-right: 45px;
  }
  
  .valor {
    font-size: 22px;
  }
  
  .detail-item {
    padding: 10px;
  }
  
  .detail-description {
    font-size: 12px;
    line-height: 1.2;
  }
  
  .detail-value {
    font-size: 13px;
  }
  
  .detail-date {
    font-size: 11px;
  }
  
  .month-total, 
  .month-difference {
    font-size: 12px;
  }
  
  .comparison-header {
    font-size: 13px;
  }
  
  .comparison-value {
    font-size: 12px;
  }
  
  .comparison-summary {
    padding: 12px;
  }
  
  .month-comparison {
    padding: 8px;
  }
  
  .month-header span {
    font-size: 12px;
  }
  
  .month-total span:last-child,
  .month-difference span:last-child {
    font-size: 12px;
  }
  
  .month-total span:first-child,
  .month-difference span:first-child {
    font-size: 11px;
  }
  
  .comparison-details > div {
    font-size: 12px;
  }
}

@media screen and (min-width: 481px) and (max-width: 1024px) {
  .dashboard {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
  
  .card {
    min-height: 400px;
  }
}

/* Top 3 Gastos */
.top-expenses {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 15px;
  margin: 15px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.top-expenses-header {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-expenses-header i {
  color: #ffd700;
  font-size: 18px;
}

.top-expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.top-expense-item:last-child {
  margin-bottom: 0;
}

.top-expense-rank {
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 24px;
  text-align: center;
}

.top-expense-info {
  flex: 1;
  margin: 0 10px;
}

.top-expense-description {
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}

.top-expense-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.top-expense-value {
  font-size: 14px;
  font-weight: 600;
  color: #4c49ea;
}

/* Redesign da seção de comparação mensal */
.comparison-summary {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
}

.month-comparison {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-value {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.comparison-value.increase {
  background: rgba(76, 175, 80, 0.1);
}

.comparison-value.decrease {
  background: rgba(244, 67, 54, 0.1);
}