/* ==========================================
   HISTORY PAGE — PREMIUM PRUSSIAN BLUE THEME
   Primary: #02113B
   Accent:  #052275
   Surface: Silver / Soft Grey
   ========================================== */

/* ==========================================
   HEADER
   ========================================== */

.header-section {
  text-align: center;
  padding: 22px 16px;
  background: linear-gradient(135deg, #02113B, #052275);
  color: white;
  border-radius: 0 0 22px 22px;
  margin-bottom: 22px;
}

.header-section h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-section h3 {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 400;
  opacity: 0.85;
}

/* ==========================================
   FILTER SECTION
   ========================================== */

.filter-section {
  max-width: 520px;
  margin: 0 auto 18px auto;
  padding: 0 18px;
}

.filter-select {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  border-radius: 14px;

  border: 1px solid rgba(2, 17, 59, 0.15);
  background: rgba(255, 255, 255, 0.9);

  cursor: pointer;
  transition: 0.2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #052275;
  box-shadow: 0 0 0 3px rgba(5, 34, 117, 0.15);
}

/* ==========================================
   EXPENSE LIST WRAPPER
   ========================================== */

.expense-list {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ==========================================
   EXPENSE CARD (Main Layout)
   ========================================== */

.expense-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;

  border: 1px solid rgba(2, 17, 59, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.expense-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(2, 17, 59, 0.12);
}

/* ==========================================
   CARD HEADER
   ========================================== */

.expense-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.expense-icon-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.expense-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(5, 34, 117, 0.08);
  padding: 8px;
  object-fit: contain;
}

.expense-category {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.expense-date {
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280;
}

/* Amount */
.expense-amount {
  font-size: 18px;
  font-weight: 800;
  color: #02113B;
}

/* ==========================================
   CARD BODY
   ========================================== */

.expense-description {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.4;
}

/* ==========================================
   CARD FOOTER
   ========================================== */

.expense-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-top: 12px;
  border-top: 1px solid rgba(2, 17, 59, 0.08);
}

/* Payment Badge */
.payment-badge {
  background: rgba(5, 34, 117, 0.12);
  color: #052275;

  padding: 5px 14px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 600;
}

/* ==========================================
   EDIT + DELETE BUTTONS
   ========================================== */

.expense-actions {
  display: flex;
  gap: 10px;
}

.btn-edit,
.btn-delete {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 7px 14px;
  border-radius: 10px;

  border: none;
  cursor: pointer;

  font-size: 13px;
  font-weight: 600;

  transition: 0.2s ease;
}

/* Edit Button */
.btn-edit {
  background: rgba(5, 34, 117, 0.12);
  color: #052275;
}

.btn-edit:hover {
  background: rgba(5, 34, 117, 0.22);
}

/* Delete Button */
.btn-delete {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.btn-delete:hover {
  background: rgba(220, 38, 38, 0.22);
}

/* ==========================================
   PAST MONTH FEATURE
   ========================================== */

.past-month-section {
  padding: 0 18px;
  margin-bottom: 16px;
}

.past-month-btn {
  width: 100%;
  padding: 14px;

  background: linear-gradient(135deg, #02113B, #052275);
  color: white;

  border: none;
  border-radius: 16px;

  font-size: 15px;
  font-weight: 700;

  cursor: pointer;
  transition: all 0.25s ease;

  box-shadow: 0 6px 18px rgba(2, 17, 59, 0.25);
}

.past-month-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(2, 17, 59, 0.35);
}

/* ==========================================
   MONTH DROPDOWN OVERLAY
   ========================================== */

.month-dropdown-container {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;

  display: flex;
  align-items: flex-end;

  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.month-dropdown-header {
  background: white;
  padding: 18px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  border-radius: 22px 22px 0 0;
  border-bottom: 1px solid rgba(2, 17, 59, 0.08);
}

.month-dropdown-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}

.close-dropdown {
  width: 34px;
  height: 34px;
  border-radius: 50%;

  border: none;
  background: rgba(2, 17, 59, 0.08);

  cursor: pointer;
  font-size: 18px;
  transition: 0.2s;
}

.close-dropdown:hover {
  background: rgba(2, 17, 59, 0.16);
}

/* Month List */
.month-list {
  background: white;
  max-height: 420px;
  overflow-y: auto;
  padding: 14px;

  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(25px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.month-item {
  width: 100%;
  padding: 15px;

  background: rgba(2, 17, 59, 0.04);
  border: 1px solid rgba(2, 17, 59, 0.08);

  border-radius: 14px;
  margin-bottom: 10px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  cursor: pointer;
  transition: 0.2s ease;
}

.month-item:hover {
  border-color: #052275;
  transform: translateX(4px);
}

.month-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.month-arrow {
  font-size: 18px;
  color: #052275;
}

.no-past-months {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

/* ==========================================
   MONTH SUMMARY VIEW
   ========================================== */

.month-summary-container {
  padding: 18px;
}

.summary-total {
  background: linear-gradient(135deg, #02113B, #052275);
  padding: 22px;
  border-radius: 18px;
  margin-bottom: 22px;

  color: white;
  box-shadow: 0 10px 28px rgba(2, 17, 59, 0.3);
}

.summary-label {
  font-size: 13px;
  opacity: 0.85;
}

.summary-amount {
  font-size: 34px;
  font-weight: 800;
  margin: 8px 0 0 0;
}

/* Breakdown Items */
.summary-category-item {
  background: white;
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 12px;

  border: 1px solid rgba(2, 17, 59, 0.08);
}

.summary-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.summary-cat-icon {
  width: 26px;
  height: 26px;
}

.summary-cat-name {
  flex: 1;
  font-weight: 600;
  color: #111827;
}

.summary-cat-amount {
  font-weight: 700;
  color: #02113B;
}

/* Progress */
.summary-progress-bar {
  background: rgba(2, 17, 59, 0.12);
  height: 8px;
  border-radius: 10px;
  overflow: hidden;
}

.summary-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #052275, #02113B);
  border-radius: 10px;
  transition: width 0.6s ease;
}

.summary-cat-percent {
  text-align: right;
  font-size: 12px;
  margin-top: 6px;
  color: #6b7280;
}

/* ==========================================
   MOBILE OPTIMIZATION
   ========================================== */

@media (max-width: 480px) {
  .header-section h1 {
    font-size: 24px;
  }

  .expense-card {
    padding: 14px;
  }

  .expense-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .expense-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
