* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #f3f6fb;
  color: #1f2937;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  width: 100%;
  max-width: 980px;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  padding: 28px;
}

.header {
  margin-bottom: 24px;
}

.header h1 {
  font-size: 2rem;
  color: #0f172a;
  margin-bottom: 8px;
}

.header p {
  color: #64748b;
  line-height: 1.5;
}

.section-title {
  margin: 22px 0 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.date-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 600;
  color: #0f172a;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 10px;
}

.buttons {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

button[type="submit"] {
  background: #2563eb;
  color: white;
}

button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.results {
  margin-top: 24px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
}

.results h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: #0f172a;
}

#summaryText {
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 14px;
}

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.breakdown {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-card span {
  color: #64748b;
  font-size: 0.92rem;
}

.mini-card strong {
  color: #0f172a;
  font-size: 1.05rem;
}

.detail-list {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 16px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

.row:last-child {
  border-bottom: none;
}

.row.total {
  padding-top: 14px;
  font-size: 1.06rem;
}

.row.total strong {
  color: #16a34a;
}

.note {
  margin-top: 14px;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .date-group,
  .grid,
  .mini-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .card {
    padding: 20px;
  }

  .date-group,
  .grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .buttons {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .date-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
}