:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182230;
  background: #f6f8fb;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(#eef3ff 0 220px, #f6f8fb 220px); }
button, input { font: inherit; }

.shell { width: min(1060px, calc(100% - 36px)); margin: 0 auto; padding: 68px 0 56px; }
header { margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: #315aa8; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.12em; }
h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1; letter-spacing: -0.05em; }
.subtitle { margin: 16px 0 0; color: #637083; font-size: 1.05rem; }
h2 { margin: 0 0 18px; font-size: 1.18rem; }

.card {
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(28, 45, 72, 0.05);
  padding: 24px;
  margin-bottom: 18px;
}

.row, .expense-grid { display: grid; gap: 14px; align-items: end; }
.row { grid-template-columns: 1fr auto; }
.expense-grid { grid-template-columns: 1.4fr 0.8fr auto; }

.field { display: grid; gap: 8px; color: #445064; font-size: 0.88rem; font-weight: 700; }
input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 13px;
  color: #182230;
  background: #fff;
  outline: none;
}
input:focus { border-color: #3766c1; box-shadow: 0 0 0 3px rgba(55, 102, 193, 0.12); }

button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  min-height: 44px;
  background: #315aa8;
  color: white;
  font-weight: 800;
  cursor: pointer;
}
button:hover { background: #284d91; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.metric { display: grid; gap: 7px; }
.metric span { color: #667085; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; }
.metric strong { font-size: 1.65rem; }
.negative { color: #b42318; }

.error { min-height: 1.2em; margin: 10px 0 -2px; color: #b42318; font-size: 0.88rem; font-weight: 700; }
.list-heading { display: flex; justify-content: space-between; align-items: center; }
.list-heading span { color: #667085; font-size: 0.88rem; }
.expense-list { list-style: none; padding: 0; margin: 0; }
.expense-list li { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-top: 1px solid #edf0f4; }
.expense-list .empty { color: #798394; }

@media (max-width: 720px) {
  .summary, .row, .expense-grid { grid-template-columns: 1fr; }
  button { width: 100%; }
  .shell { padding-top: 42px; }
}

/* HW3 additions retain the original visual design. */
.notice { padding: 18px 22px; margin: 0 0 20px; border: 1px solid #cedaf2; border-radius: 12px; background: #edf3ff; color: #31445f; font-size: .9rem; line-height: 1.55; }
.hint { color: #637083; font-size: .85rem; line-height: 1.5; }
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end; }
select { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: 12px 13px; font: inherit; color: #182230; background: #fff; }
.entry-details { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.entry-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: end; }
.secondary { background: #eef2f7; color: #31445f; border: 1px solid #d5deeb; font-weight: 600; }
.secondary:hover { background: #e0e8f3; }
button:disabled { cursor: wait; opacity: .55; }
footer { margin-top: 24px; color: #667085; font-size: .8rem; text-align: center; line-height: 1.6; }
@media (max-width: 720px) { .entry-grid { grid-template-columns: 1fr; } .expense-list li { flex-direction: column; } .entry-actions { justify-content: start; } .entry-actions button { width: auto; } }
