:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --green-light: #a7e6d7;
  --green: #8ddbc8;
  --green-dark: #4aa785;
  --green-darker: #3a8c6e;
  --border: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  padding: 32px 16px;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
}

h1, h2 {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 1.875rem;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.375rem;
}

.card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 32px;
}

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

input,
select {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(141, 219, 200, 0.2);
}

button {
  padding: 12px 20px;
  background: var(--green-dark);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

button:hover {
  background: var(--green-darker);
  transform: translateY(-1px);
}

button.secondary {
  background: var(--text-light);
}

button.secondary:hover {
  background: #4b5563;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-top: 16px;
}

th,
td {
  padding: 12px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f1f5f9;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td:first-child,
th:first-child {
  text-align: left;
}

.positivo {
  color: #166534;
  font-weight: 600;
}

.negativo {
  color: #991b1b;
  font-weight: 600;
}

.resumen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.res-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.res-box h3 {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 500;
}

.res-box strong {
  font-size: 1.5rem;
  color: var(--text);
  display: block;
}

.res-box.iva-final {
  background: var(--green-light);
  border-color: var(--green);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-light);
}

.delete-btn {
  color: var(--text-light);
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s;
}

.delete-btn:hover {
  color: #991b1b;
}

.actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 16px 12px;
  }

  .card {
    padding: 20px;
  }

  form {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: 10px 6px;
  }
}