:root {
  --primary: #0a7b5a;
  --primary-soft: #0a7b5a22;
  --bg: #f4f4f4;
  --card-bg: #ffffff;
  --text: #222;
}

body {
  font-family: system-ui, sans-serif;
  padding: 20px;
  margin: 0;
  background: radial-gradient(circle at top left, #e0f7f1, #f4f4f4);
  color: var(--text);
}

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

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

.title-main {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
}

.subtitle {
  margin: 6px 0 12px;
  font-size: 0.9rem;
  color: #555;
}

.btn-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

button {
  padding: 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: 0.1s ease;
}

button:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-export {
  background: white;
  border: 1px solid #ddd;
}

#reader {
  width: 100%;
  max-width: 420px;
  margin: auto;
  border-radius: 14px;
  border: 1px solid #ddd;
  background: black;
  overflow: hidden;
}

#result-card {
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
}

#result-status {
  font-weight: 600;
  margin-bottom: 6px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #ececec;
  font-size: 0.8rem;
  display: inline-flex;
  gap: 4px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#count-label {
  font-size: 0.8rem;
  color: #666;
}

#list {
  list-style: none;
  padding: 0;
  border: 1px solid #eee;
  border-radius: 10px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
}

#list li {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

#list li:last-child {
  border-bottom: none;
}

.li-main {
  font-weight: 600;
}

.li-meta {
  font-size: 0.78rem;
  color: #555;
}

/* Tabla de rangos */
.ranges-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ranges-table th,
.ranges-table td {
  border: 1px solid #e4e4e4;
  padding: 6px 8px;
}

.ranges-table th {
  background: #f5f5f5;
}

.ranges-table caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 4px;
}

/* Formulario manual */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 0.8rem;
  color: #444;
}

.field input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 14px;
  }
  .card {
    padding: 14px 12px;
  }
  .title-main {
    font-size: 1.2rem;
  }
  button {
    font-size: 0.85rem;
  }
}

.li-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-list {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #f9f9f9;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-list:hover {
  background: #f1f1f1;
}

.btn-danger {
  border-color: #ffb3b3;
  background: #ffe5e5;
}

.hidden {
  display: none !important;
}

