:root {
  --bg: #0f172a;
  --card-bg: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #16a34a;
  --border: #e2e8f0;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.wrap {
  width: 100%;
  max-width: 520px;
}

header {
  text-align: center;
  margin-bottom: 24px;
  color: #f8fafc;
}

header h1 {
  font-size: 1.75rem;
  margin: 0 0 8px;
}

.subtitle {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 16px;
}

label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.row {
  display: flex;
  gap: 16px;
}

.row > label {
  flex: 1;
}

input[type="number"],
select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
  color: var(--text);
  font-weight: 400;
}

input[type="number"]:focus,
select:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover { background: var(--primary-dark); }

.resultado h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.destacado {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.destacado .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.destacado .valor {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.detalle {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.detalle td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.detalle td:last-child {
  text-align: right;
  font-weight: 600;
}

.aviso {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.error {
  background: #fee2e2;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
}

.oculto { display: none; }
