.gift-batch-tools, .gift-batch-card-check, .gift-batch-dialog label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.gift-batch-tools { gap: .8rem; margin: .25rem 0 .75rem; flex-wrap: wrap; }
.gift-batch-tools label, .gift-batch-card-check { min-height: 2.25rem; cursor: pointer; }
.gift-batch-card-check { min-width: 1.65rem; justify-content: center; }
.gift-batch-tools input[type="checkbox"], .gift-batch-card-check input, .gift-batch-dialog input[type="checkbox"] {
  width: 1.12rem;
  height: 1.12rem;
  flex: 0 0 auto;
  accent-color: var(--admin-accent);
}
.gift-batch-bar {
  position: fixed;
  z-index: 10;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .85rem;
  padding: .7rem 1rem max(.7rem, env(safe-area-inset-bottom));
  background: var(--admin-surface);
  color: var(--admin-text);
  border-top: 1px solid var(--admin-line);
}
.has-gift-batch-selection #adminDashboard { padding-bottom: 5rem; }
.gift-batch-dialog {
  width: min(47rem, calc(100vw - 1.5rem));
  max-height: min(85dvh, 55rem);
  padding: 0;
  border: 1px solid var(--admin-control);
  border-radius: 1rem;
  background: var(--admin-surface);
  color: var(--admin-text);
}
.gift-batch-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.gift-batch-dialog::backdrop { background: #030b1b99; }
.gift-batch-dialog > header, .gift-batch-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
}
.gift-batch-dialog > header { border-bottom: 1px solid var(--admin-line); }
.gift-batch-dialog > footer { border-top: 1px solid var(--admin-line); flex-wrap: wrap; }
.gift-batch-dialog h2, .gift-batch-dialog h3 { margin: 0; }
.gift-batch-dialog h2 { font-size: 1.15rem; }
.gift-batch-dialog h3 { font-size: 1rem; margin-top: 1.1rem; margin-bottom: .55rem; }
.gift-batch-body { padding: .8rem 1rem 1rem; overflow: auto; }
.gift-batch-body p { margin: 0 0 .55rem; }
.gift-batch-summary { font-weight: 700; }
.gift-batch-suggestion { background: var(--admin-warning); padding: .65rem; border-radius: .5rem; }
.gift-batch-table { overflow-x: auto; }
.gift-batch-table table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.gift-batch-table :is(th, td) { padding: .45rem .3rem; border-bottom: 1px solid var(--admin-line); text-align: right; }
.gift-batch-table th:first-child { text-align: left; }
.gift-batch-dialog small { color: var(--admin-muted); }
.gift-batch-table small, .gift-batch-reasons { display: block; }
.gift-batch-orders, .gift-batch-orders ul { list-style: none; padding: 0; margin: 0; }
.gift-batch-orders > li { border-top: 1px solid var(--admin-line); padding: .65rem 0; }
.gift-batch-order-head, .gift-batch-gift { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .65rem; }
.gift-batch-orders ul > li { margin: .38rem 0; }
.gift-batch-state { border-radius: .3rem; padding: .12rem .4rem; font-size: .82rem; background: var(--admin-soft); }
.gift-batch-state[data-state="waiting"] { background: var(--admin-warning); }
.gift-batch-partial { margin-top: .35rem; }
.gift-batch-tools button, .gift-batch-bar button, .gift-batch-dialog button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: .45rem .75rem;
  border: 1px solid var(--admin-control);
  border-radius: .5rem;
  color: var(--admin-text);
  background: var(--admin-soft);
}
.gift-batch-bar button, #giftBatchConfirm { background: var(--admin-accent); color: var(--admin-surface); }
.gift-batch-bar button:disabled, #giftBatchConfirm:disabled { opacity: .52; cursor: default; }
.gift-batch-tools [hidden], .gift-batch-tools[hidden], .gift-batch-bar[hidden], .gift-batch-dialog [hidden] { display: none; }
@media (max-width: 480px) {
  .gift-batch-dialog { max-height: 92dvh; }
  .gift-batch-dialog > footer button { width: 100%; }
  .gift-batch-table :is(th, td) { font-size: .8rem; }
}

/* ===== Rediseño 2026-11-28: selección más ordenada ===== */
/* Casilla propia: redondeada, amarilla con ✓ al marcar. */
.gift-batch-card-check, .gift-batch-tools label { min-height: 0 !important; }
.gift-batch-card-check { min-width: 0 !important; margin: 0 !important; flex: none; }
body #adminDashboard :is(.gift-batch-card-check, .gift-batch-tools) input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 22px !important; height: 22px !important; margin: 0;
  border: 2px solid rgba(255, 255, 255, .35); border-radius: 7px; background: transparent; cursor: pointer;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
body #adminDashboard :is(.gift-batch-card-check, .gift-batch-tools) input[type="checkbox"]:checked {
  border-color: #ffd60a; background: #ffd60a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1400' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
}
body #adminDashboard :is(.gift-batch-card-check, .gift-batch-tools) input[type="checkbox"]:indeterminate {
  border-color: #ffd60a; background: #ffd60a linear-gradient(#1a1400, #1a1400) center / 10px 3px no-repeat;
}
body #adminDashboard :is(.gift-batch-card-check, .gift-batch-tools) input[type="checkbox"]:focus-visible { outline: 2px solid #ffd60a; outline-offset: 2px; }
:root[data-admin-theme="light"] body #adminDashboard :is(.gift-batch-card-check, .gift-batch-tools) input[type="checkbox"]:not(:checked) { border-color: rgba(11, 27, 58, .35); }

/* La casilla va pegada a la imagen del producto, en la misma fila. */
body #adminDashboard .compact-product-identity:has(> .gift-batch-card-check) { gap: 14px; }
body #adminDashboard .order-card-identity > .gift-batch-card-check { margin-right: 4px !important; }

/* Tarjeta seleccionada: borde amarillo. */
body #adminDashboard .order-card:has(.gift-batch-card-check input:checked) {
  box-shadow: 0 0 0 2px #ffd60a !important;
}

/* «Seleccionar todos» como pastilla, igual que los filtros. */
body #adminDashboard .gift-batch-tools { margin: 4px 0 14px !important; }
body #adminDashboard .gift-batch-tools > label {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 12px;
  border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  font-size: 14px; font-weight: 700; color: var(--admin-text); user-select: none;
}
body #adminDashboard .gift-batch-tools > label:hover { background: rgba(255, 255, 255, .1); }
:root[data-admin-theme="light"] body #adminDashboard .gift-batch-tools > label { background: #fff; border-color: rgba(11, 27, 58, .12); }

/* Barra de abajo: flotante y redondeada. */
.gift-batch-bar {
  inset: auto 16px 18px !important; width: fit-content; max-width: calc(100vw - 32px); margin: 0 auto;
  padding: 8px 8px 8px 20px !important; gap: 16px !important; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12) !important; box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  font-weight: 700;
}
.gift-batch-bar button {
  min-height: 42px; padding: 0 20px !important; border: 0 !important; border-radius: 999px !important;
  background: #ffd60a !important; color: #1a1400 !important; font-weight: 800 !important;
}
body #adminDashboard .gift-batch-tools > button {
  height: 40px; padding: 0 16px !important; border-radius: 999px !important; font-size: 14px !important;
  background: rgba(255, 255, 255, .06) !important; border: 1px solid rgba(255, 255, 255, .1) !important;
}
