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

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a2e;
}

.subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-top: 4px;
  margin-bottom: 24px;
}

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

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

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

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

label {
  font-size: 0.8rem;
  color: #555;
  font-weight: 500;
}

input[type="text"],
input[type="number"] {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

input:focus {
  border-color: #3b82f6;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

.error-msg {
  color: #e53e3e;
  font-size: 0.82rem;
  margin-top: 8px;
  min-height: 18px;
}

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

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: #f0f4ff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: #444;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid #f0f0f0;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 10px 12px;
  white-space: nowrap;
}

.unit-cost {
  font-weight: 700;
  color: #2563eb;
}

.delete-btn {
  background: #fee2e2;
  color: #e53e3e;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.delete-btn:hover {
  background: #fca5a5;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.88rem;
  padding: 24px 0;
}

/* Summary */
.summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

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

.summary-item {
  background: #f8faff;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 0.75rem;
  color: #666;
}

.summary-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
}
