/* Base styles */
:root {
  --bg: #0b1020;
  --card: #111731;
  --muted: #97a0b8;
  --text: #e8ecf8;
  --accent: #5b8cff;
  --accent-2: #7f56d9;
  --error: #ff6363;
  --ok: #4ade80;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 20px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #10214a33, transparent),
              radial-gradient(1000px 500px at 120% 20%, #4a103333, transparent),
              var(--bg);
  color: var(--text);
}

.container {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 740px;
  background: linear-gradient(180deg, #0f1630 0%, #0c1228 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
}

h1 {
  margin: 0 0 18px;
  font-size: 24px;
}

.field-row { margin-bottom: 16px; }
label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 14px; }
input[type="text"], input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1228;
  color: var(--text);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder { color: #64708a; }
input:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px #3b82f61a; }

.error { display: block; color: var(--error); margin-top: 6px; min-height: 18px; font-size: 12px; }

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

.actions { display: flex; gap: 12px; margin-top: 8px; }
button {
  appearance: none;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
}
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button:disabled { opacity: .6; cursor: not-allowed; }

.results { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); }
.results.hidden { display: none; }
.results h2 { margin: 0 0 12px; font-size: 18px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-label { color: var(--muted); font-size: 13px; display: block; margin-bottom: 6px; }
.result-value { font-size: 18px; font-weight: 700; }

/* Report table */
.report { margin-top: 16px; }
.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  background: #0b1228;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.report-table th, .report-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.report-table thead th { background: rgba(255,255,255,0.04); color: var(--muted); font-weight: 600; }
.report-table tbody tr:last-child td { border-bottom: none; }

.print-actions { justify-content: flex-end; }

.footer { text-align: center; color: var(--muted); margin-top: 16px; font-size: 12px; }

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

/* Print styles */
@media print {
  body { background: white; color: #111; }
  .container { padding: 0; }
  .card {
    max-width: none;
    box-shadow: none;
    border: none;
    background: white;
    color: #111;
    padding: 0;
  }
  .footer, .actions { display: none !important; }
  input, .error { display: none !important; }
  .results { border-top: none; }
  .report-table { background: white; border: 1px solid #ddd; }
  .report-table th { background: #f5f5f5; color: #111; }
  .result-label { color: #444; }
}
