:root {
  --primary: #1f7a8c;
  --primary-strong: #136074;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #d9e2ec;
  --text: #1f2933;
  --muted: #6b7b8c;
  --danger: #c0392b;
  --success: #2f9e44;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #f0f4f8 0%, #e9eef5 50%, #f5f7fa 100%);
  color: var(--text);
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  font-size: 26px;
  margin: 0 0 4px 0;
}

.subtitle {
  margin: 0 0 18px 0;
  color: var(--muted);
}

.actions-top {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.05s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.btn:active {
  transform: translateY(1px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px 16px;
}

.grid-dense {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 16px;
}

.attributes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  /* Más espacio horizontal entre items */
  margin-bottom: 16px;
}

.attributes-list>div {
  min-width: 120px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.card h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

textarea {
  min-height: 60px;
  resize: vertical;
}

.helper {
  font-size: 12px;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

th {
  background: #f4f6f8;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f4ff;
  color: var(--primary);
  border: 1px solid #c8e0f5;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.feedback {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.feedback.ok {
  background: #e9f7ef;
  border: 1px solid #b6e1c3;
  color: var(--success);
}

.feedback.error {
  background: #fdecea;
  border: 1px solid #f5c4be;
  color: var(--danger);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pill {
  font-size: 12px;
  color: var(--muted);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .actions-top {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}

/* Input group */
.input-group {
  display: flex;
  gap: 8px;
}

.input-group input {
  flex: 1;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
}

.close-modal {
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
}

#reader {
  width: 100%;
  min-height: 300px;
  background: #000;
}


.readonly-input {
  background-color: #f0f4f8;
  color: var(--muted);
  cursor: not-allowed;
}