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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #1e293b;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  padding: 16px 0 20px;
  text-align: center;
  border-bottom: 2px solid #2563eb;
  margin-bottom: 20px;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
}

/* Form */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

.form-group input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.btn-add {
  width: 100%;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add:hover {
  background: #1d4ed8;
}

/* Summary */
.summary-section {
  margin-bottom: 16px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 480px) {
  .summary-cards {
    grid-template-columns: 1fr;
  }
}

.summary-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.summary-card .label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 6px;
}

.summary-card .value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
}

.alert-card .value {
  color: #ea580c;
}

/* List */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

.toggle-paid {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #64748b;
  cursor: pointer;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-msg {
  text-align: center;
  color: #94a3b8;
  padding: 32px 0;
  font-size: 0.95rem;
}

/* Item card */
.item-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.item-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-card.overdue {
  border-left: 4px solid #ef4444;
  background: #fff5f5;
}

.item-card.soon {
  border-left: 4px solid #ea580c;
  background: #fff8f3;
}

.item-card.paid {
  opacity: 0.5;
  background: #f8fafc;
}

.item-check {
  width: 22px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #2563eb;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.item-amount {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2563eb;
}

.item-date {
  font-size: 0.82rem;
  color: #64748b;
}

.item-days {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
}

.item-days.overdue {
  background: #fee2e2;
  color: #ef4444;
}

.item-days.soon {
  background: #ffedd5;
  color: #ea580c;
}

.item-memo {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 1.1rem;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
  line-height: 1;
}

.btn-delete:hover {
  color: #ef4444;
}
