:root {
  --c-primary: #80C41F;       /* Verde Uni·co */
  --c-secondary: #00A99D;     /* Teal Uni·co */
  --c-bg: #f7f9f4;            /* off-white con tinte verde */
  --c-card: #ffffff;
  --c-text: #1a2918;
  --c-muted: #6b766b;
  --c-border: #e2e8dc;
  --c-success: #10b981;
  --c-warning: #f59e0b;
  --c-error: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(128,196,31,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.5;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.brand img.logo-iso { height: 44px; width: auto; }
.brand img.logo-full { height: 36px; width: auto; }
.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-muted);
}
.brand h1 strong { color: var(--c-text); font-weight: 700; }

.card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

h2 { font-size: 1.1rem; margin: 0 0 12px; }
.muted { color: var(--c-muted); font-size: .9rem; }

label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: .95rem; }
input[type="text"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  font-family: inherit;
}
input[type="text"]:focus, textarea:focus, select:focus {
  outline: 2px solid var(--c-primary);
  outline-offset: 1px;
}

.option-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.option {
  padding: 12px;
  border: 2px solid var(--c-border);
  border-radius: 8px;
  background: white;
  text-align: center;
  cursor: pointer;
  transition: all .15s ease;
  font: inherit;
}
.option:hover { border-color: var(--c-primary); }
.option.selected {
  border-color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 8%, white);
}
.option .label { font-weight: 600; font-size: .95rem; }
.option .sub   { font-size: .8rem; color: var(--c-muted); margin-top: 2px; }

.preview {
  margin-top: 12px;
  padding: 24px;
  border: 1px dashed var(--c-border);
  border-radius: 8px;
  background: #fafafa;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
}
.preview .preview-text { transition: all .2s ease; }

button.primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 2px 8px rgba(128,196,31,.25);
}
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.primary:hover:not(:disabled) { filter: brightness(1.05); }

button.secondary {
  padding: 10px 16px;
  background: white;
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  font-size: .95rem;
  cursor: pointer;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.qr-container #qrcode {
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.qr-container .code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.3rem;
  letter-spacing: 2px;
  background: #f0f0f4;
  padding: 6px 14px;
  border-radius: 6px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.badge.pendiente   { background: #fef3c7; color: #92400e; }
.badge.en_proceso  { background: #dbeafe; color: #1e40af; }
.badge.grabado     { background: #d1fae5; color: #065f46; }
.badge.error       { background: #fee2e2; color: #991b1b; }
.badge.cancelado   { background: #e5e7eb; color: #374151; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--c-border); }
th { font-size: .85rem; color: var(--c-muted); font-weight: 600; text-transform: uppercase; }

.error-msg { color: var(--c-error); margin-top: 8px; font-size: .9rem; }

.hide { display: none !important; }
