/* Standard CSS Reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f4f6fb;
  color: #253047;
}

.container {
  max-width: 1100px;
  margin: 35px auto;
  padding: 0 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  color: #243b68;
  margin-bottom: 10px;
}

header p {
  color: #667085;
}

/* Summary Cards */
.summary-container {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.summary-card {
  flex: 1;
  padding: 25px;
  border-radius: 12px;
  background-color: white;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:nth-child(1) {
  border-left: 5px solid #3879e8;
}

.summary-card:nth-child(2) {
  border-left: 5px solid #eb5757;
}

.summary-card:nth-child(3) {
  border-left: 5px solid #27ae60;
}

.summary-card h2 {
  font-size: 17px;
  color: #667085;
  margin: 0 0 15px;
}

.summary-card p {
  font-size: 28px;
  font-weight: bold;
  margin: 0;
}

.summary-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

/* Form & Table Sections */
.form-section,
.table-section {
  background-color: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.form-section h2,
.table-section h2 {
  margin-top: 0;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.table-header h2 {
  margin-bottom: 0;
}

#expense-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 180px;
}

.form-group label {
  font-weight: bold;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cdd5df;
  border-radius: 6px;
  font-size: 15px;
  background-color: white;
  transition: border-color 0.2s, background-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: 2px solid #8bb2fa;
  border-color: #3879e8;
}

/* Inline Validation Highlight */
.form-group input.input-error,
.form-group select.input-error {
  border-color: #eb5757;
  background-color: #fff6f6;
}

/* Buttons */
button {
  padding: 12px 22px;
  border: none;
  border-radius: 7px;
  background-color: #3879e8;
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
}

button:hover {
  background-color: #245cbb;
  box-shadow: 0 5px 12px rgba(36, 92, 187, 0.25);
}

button:focus-visible {
  outline: 3px solid #8bb2fa;
  outline-offset: 2px;
}

.secondary-btn {
  background-color: #243b68;
  padding: 9px 16px;
  font-size: 14px;
}

.secondary-btn:hover {
  background-color: #192a4d;
}

.delete-btn {
  background-color: #eb5757;
  padding: 6px 12px;
  font-size: 13px;
}

.delete-btn:hover {
  background-color: #c9302c;
  box-shadow: 0 4px 10px rgba(201, 48, 44, 0.25);
}

/* Table & Category Pills */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
  min-width: 600px;
}

th,
td {
  padding: 14px;
  border: 1px solid #d7deea;
}

thead {
  background-color: #243b68;
  color: white;
}

tbody tr:nth-child(even) {
  background-color: #f0f4fa;
}

tbody tr:hover {
  background-color: #e3edff;
}

.empty-row td {
  text-align: center;
  color: #667085;
}

.category-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  background-color: #e3edff;
  color: #245cbb;
}

.badge-food {
  background-color: #fff0e6;
  color: #d95d1e;
}

.badge-transport {
  background-color: #e6f4ff;
  color: #1677ff;
}

.badge-books {
  background-color: #f3e8ff;
  color: #7e22ce;
}

.badge-entertainment {
  background-color: #e6f9f0;
  color: #15803d;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.25s ease-out;
}

.toast.success {
  background-color: #27ae60;
}

.toast.error {
  background-color: #eb5757;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

footer {
  text-align: center;
  color: #667085;
  font-size: 14px;
  padding-bottom: 20px;
}

@media (max-width: 700px) {
  .summary-container {
    flex-direction: column;
  }

  .container {
    margin-top: 20px;
  }

  #expense-form button {
    width: 100%;
  }
}