* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

header {
  margin-bottom: 20px;
}

h1, h2 {
  margin: 0 0 8px;
}

.subtitle {
  margin: 0;
  color: #6b7280;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.field select,
.field input {
  height: 42px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

.actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

button.primary {
  background: #2563eb;
  color: white;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

button.delete-btn {
  background: #fee2e2;
  color: #991b1b;
  padding: 8px 12px;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #f8fafc;
  font-weight: 700;
  position: sticky;
  top: 0;
}

.empty-row td {
  text-align: center;
  color: #6b7280;
  padding: 22px 8px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.summary-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-box span {
  color: #6b7280;
  font-size: 14px;
}

.summary-box strong {
  font-size: 22px;
}

.total-box {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.message {
  margin-top: 14px;
  min-height: 22px;
  font-size: 14px;
  font-weight: 700;
}

.message.error {
  color: #b91c1c;
}

.message.success {
  color: #166534;
}

@media (max-width: 768px) {
  .container {
    padding: 14px;
  }

  .summary {
    grid-template-columns: 1fr;
  }
}
