/* Forzar modo claro incluso en móviles con tema oscuro */
:root { color-scheme: light only; }
html, body {
  background: #f6f7fb !important;
  color: #111827 !important;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  html, body { background: #f6f7fb !important; color: #111827 !important; }
}


/* Force light & honor [hidden] */
:root{ color-scheme: light; }
[hidden]{ display:none !important; }
.modal[hidden]{ display:none !important; }
* { box-sizing: border-box; }

.container { max-width: 1100px; margin: 0 auto; padding: 18px; }

.topbar { background: #ffffff !important; border-bottom: 1px solid #e5e7eb; }
.topbar-inner { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.brand { font-weight: 800; letter-spacing: .2px; }

.nav { display:flex; align-items:center; gap:10px; }
.nav-link { text-decoration:none; color:#374151 !important; padding: 8px 10px; border-radius: 10px; }
.nav-link.active { background: #f3f4f6; color:#111827 !important; }

.card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(17,24,39,.06);
  padding: 18px;
}
.card-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom: 14px; }
.card-header h1 { font-size: 22px; margin: 0; }

.badge { font-size: 12px; padding: 6px 10px; border-radius: 999px; background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; }

.form-grid { display:grid; gap:10px; }
.label { font-size: 13px; color:#374151 !important; }

.input, .textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff !important;
  color: #111827 !important;
  outline: none;
}
.input:focus, .textarea:focus { border-color:#f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.18); }

.actions { display:flex; gap:10px; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 1px solid #f59e0b;
  background: #f59e0b;
  color: #111827;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.btn:hover { filter: brightness(.98); }
.btn:active { transform: translateY(1px); }

.btn-outline {
  background: #ffffff !important;
  border: 1px solid #d1d5db;
  color: #374151 !important;
}

.msg { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid #d1fae5; background:#ecfdf5; color:#065f46 !important; }
.msg-error { border-color:#fecaca; background:#fef2f2; color:#991b1b !important; }

.result { margin-top: 14px; border-top:1px dashed #e5e7eb; padding-top: 14px; }
.result-head { display:flex; align-items:center; justify-content:space-between; gap: 10px; flex-wrap: wrap; }
.result-name { font-size: 20px; font-weight: 800; }
.result-ced { font-size: 13px; color:#6b7280 !important; margin-top: 2px; }

.barcode-wrap { margin-top: 14px; display:flex; justify-content:center; }
.barcode-wrap img {
  width: min(760px, 100%);
  height: auto;
  background:#fff !important;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  image-rendering: pixelated;
}

.barcode-note{
  margin-top: 10px;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2px;
}

.note { margin-top: 10px; color:#374151 !important; font-size: 13px; }

.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.table-wrap { overflow:auto; }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { text-align:left; padding: 10px; border-bottom: 1px solid #e5e7eb; }
.table th { font-size: 12px; color:#6b7280 !important; text-transform: uppercase; letter-spacing: .04em; }

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

.search { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.search .input { width: 280px; }

.copybox { margin-top: 14px; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; background: #fafafa !important; }
.copybox-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom: 10px; }
.copybox-title { font-weight: 800; }
.small { font-size: 12px; color:#6b7280 !important; }

.modal { position: fixed; inset: 0; background: rgba(17,24,39,.55); display:none; align-items:center; justify-content:center; padding: 16px; z-index: 9999; }
.modal.is-open { display:flex; }
.modal-card { width: 100%; max-width: 560px; background:#fff !important; border-radius: 18px; border: 1px solid #e5e7eb; padding: 16px; }
.modal-head { display:flex; justify-content:space-between; align-items:center; gap: 10px; margin-bottom: 12px; }
.modal-title { font-weight: 900; }
