body {
  font-family: system-ui, sans-serif;
  padding: 1rem;
  background: #fafafa;
}

h1 {
  text-align: center;
}

form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

input, button {
  padding: 0.6rem;
  font-size: 1rem;
}

button {
  background: #111;
  color: white;
  border: none;
  border-radius: 6px;
}

.actions {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  background: white;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

ul#list {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul#list li {
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
  transition: transform 0.1s;
}

ul#list li:hover {
  transform: scale(1.02);
}

ul#list li button {
  background: #E53935;
  border: none;
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

ul#list li button:hover {
  background: #B71C1C;
}

ul#list li:nth-child(odd) {
  background: #fefefe;
}

ul#list li:nth-child(even) {
  background: #f7f7f7;
}

.tag {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: white;
}

#category {
  height: 2.5rem;       /* taller select box */
  font-size: 1rem;      /* optional, bigger text */
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

#category option {
  height: 2.5rem;       /* taller select box */
  font-size: 1rem;      /* optional, bigger text */
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}

#merchant, #notes, #amount, #date {
  height: 2.5rem;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.category { background: #4CAF50; }   /* green */
.merchant { background: #2196F3; }   /* blue */
.notes    { background: #FF9800; }   /* orange */

.amount-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.amount-row input[type="number"] {
  flex: 1;
}

.income-toggle {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.header {
  display: flex;
  justify-content: space-between; /* title left, menu right */
  align-items: center;           /* vertical alignment */
  padding: 0.5rem 1rem;
  position: relative;            /* for menu positioning */
  background: none;              /* optional background */
}

.header h1 {
  font-size: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-wrapper {
  position: relative;
  display: inline-block; /* keeps it inline with the title if needed */
}

.menu-btn {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  color: #000;
}

.menu {
  position: absolute;
  right: 0;
  top: 100%; /* just below the button */
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border-radius: 5px;
  min-width: 150px;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.menu.hidden {
  display: none !important; /* hidden when toggled off */
}

.menu button {
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: #000;
}

.menu button.danger {
  color: red;
}

.menu button:disabled {
  color: gray;
  cursor: default;
}

.dashboard {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.period {
  font-weight: bold;
  font-size: 1rem;
}

.summary-cards {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.card {
  background: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  font-weight: bold;
}

.income-card { border-left: 6px solid #2E7D32; }
.expense-card { border-left: 6px solid #C62828; }
.net-card { border-left: 6px solid #1565C0; }

#monthlyChart {
  max-width: 250px;   /* shrink chart */
  max-height: 250px;
}

.hidden {
  display: none;
}