:root {
  --fondo: #f6f4ef;
  --papel: #fffdf8;
  --texto: #1c1f1e;
  --suave: #5b6360;
  --linea: #d9d4c7;
  --marca: #0f6b5c;
  --marca-osc: #0b5246;
  --peligro: #a3342b;
  --aviso: #fff3cf;
  --ok: #dff2e6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 18px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.solo { padding-bottom: 24px; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: 8px 0 16px; }
h2 { font-size: 1.2rem; margin: 20px 0 8px; }
a { color: var(--marca); }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
input, select, textarea {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  font: inherit;
  color: var(--texto);
  background: var(--papel);
  border: 2px solid var(--linea);
  border-radius: 10px;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--marca); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.opcion { display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 0 0 8px; padding: 0 12px; background: var(--papel); border: 2px solid var(--linea); border-radius: 10px; font-weight: 500; }
.opcion input { width: 24px; min-height: 24px; height: 24px; }
.btn {
  display: inline-block;
  min-height: 52px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--marca);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover { background: var(--marca-osc); }
.btn.grande { display: block; width: 100%; margin-top: 16px; font-size: 1.1rem; min-height: 58px; }
.btn.peligro { background: var(--peligro); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.gris { background: #7a817e; }
.mini { font-size: .9rem; color: var(--suave); margin: 4px 0; }
.aviso { padding: 12px 14px; margin: 12px 0; background: var(--aviso); border-radius: 10px; }
.aviso.err { background: #fbe0dc; color: #6d1b14; }
.aviso.ok { background: var(--ok); }
.resumen { font-size: 1.15rem; font-weight: 600; margin: 18px 0 0; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { margin: 0 0 10px; }
.fila { display: block; padding: 12px 14px; color: inherit; text-decoration: none; background: var(--papel); border: 2px solid var(--linea); border-radius: 10px; min-height: 52px; }
.fila-arriba { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.fila-abajo { display: block; font-size: .9rem; color: var(--suave); margin-top: 2px; }
.filtros { display: grid; gap: 6px; margin-bottom: 14px; }
.filtros .btn { margin-top: 10px; }
.vacio { color: var(--suave); }
.badge { display: inline-block; padding: 2px 10px; font-size: .85rem; font-weight: 700; border-radius: 999px; background: #e6e2d6; white-space: nowrap; }
.badge.aceptado, .badge.aceptado_condicional { background: var(--ok); color: #0b4a2c; }
.badge.rechazado, .badge.error { background: #fbe0dc; color: #6d1b14; }
.badge.anulada { background: #ddd; color: #444; text-decoration: line-through; }
.datos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 14px 0; }
.datos dt { color: var(--suave); }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.acciones { display: grid; gap: 4px; margin-top: 18px; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; background: var(--papel); border-top: 2px solid var(--linea);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a, .tabs button {
  flex: 1; min-height: 60px; display: flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 700; text-decoration: none; color: var(--suave); background: none; border: 0;
}
.tabs form { display: flex; flex: 1; margin: 0; }
.tabs .on { color: var(--marca); box-shadow: inset 0 3px 0 var(--marca); }
.pend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: var(--papel); border: 2px dashed var(--linea); border-radius: 10px; }
.pend span { flex: 1 1 100%; }
.pend .btn { min-height: 44px; padding: 6px 14px; }
.pend .btn.gris { background: #7a817e; }
.aviso-fijo .copia { user-select: text; -webkit-user-select: text; font-size: .95rem; }
.aviso-fijo .btn { min-height: 44px; padding: 6px 14px; }
