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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f6f8;
  color: #1f2937;
  line-height: 1.5;
}

header {
  background: #1f4e78;
  color: white;
  padding: 1.5rem 2rem;
  border-bottom: 4px solid #d4a017;
}

header h1 { font-size: 1.5rem; font-weight: 600; }
.subtitle { font-size: 0.9rem; opacity: 0.85; margin-top: 0.25rem; }

main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 2rem;
}

section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

h2 { font-size: 1.15rem; margin-bottom: 1rem; color: #1f4e78; }
h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; color: #4b5563; text-transform: uppercase; letter-spacing: 0.5px; }

.date-inputs {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}

.date-inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.date-inputs label span {
  font-size: 0.85rem;
  color: #6b7280;
}

input[type="date"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}

button {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  background: #1f4e78;
  color: white;
  transition: background 0.15s;
}
button:hover:not(:disabled) { background: #16395a; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: #16a34a; }
.btn-primary:hover:not(:disabled) { background: #15803d; }

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-top: 1rem;
}

.loading-section {
  text-align: center;
  padding: 3rem 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #1f4e78;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.preview-header h2 { margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem;
}

.card h3 { margin-top: 0; }
.big { font-size: 1.5rem; font-weight: 600; color: #111827; }
.small { font-size: 0.85rem; color: #6b7280; margin-top: 0.5rem; }

table.mini {
  width: 100%;
  font-size: 0.9rem;
}
table.mini td:first-child { color: #6b7280; }
table.mini td:last-child { text-align: right; font-weight: 500; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

table.data th, table.data td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

table.data th {
  background: #f3f4f6;
  font-weight: 600;
  color: #4b5563;
}

table.data .num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

footer {
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
  font-size: 0.85rem;
}
