:root {
  --cream: #fbf3d3;
  --black: #141414;
  --charcoal: #2a2a2a;
  --charcoal-light: #333333;
  --orange: #f2a93b;
  --orange-dark: #e0951f;
  --red: #d5352b;
  --white: #ffffff;
  --ink: #1c1c1c;
  --muted: #6b6b63;
  /* Tokens de tema (el modo oscuro los redefine más abajo) */
  --surface: #ffffff;
  --surface-2: #faf8ec;
  --surface-3: #f1ede0;
  --note-bg: #fff8e6;
  --hair: #eee;
  --hair-2: #ccc;
  --edge: #141414;
  --text-2: #4f4a3c;
  --text-3: #8a8470;
  --radius: 10px;
  --font-display: "Baloo 2", sans-serif;
  --font-body: "Nunito", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--black);
  padding: 14px 24px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
  font-size: 1.4rem;
  letter-spacing: 0.3px;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 18px;
}
.search-wrap .icon { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.search-wrap input {
  border: none;
  outline: none;
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: transparent;
}

.topbar-icon-btn {
  position: relative;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--charcoal-light);
  border: 2px solid transparent;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.topbar-icon-btn svg { width: 22px; height: 22px; }
.topbar-icon-btn:hover { background: #3d3d3d; }
.topbar-icon-btn.active { border-color: var(--orange); }
.topbar-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--orange);
  color: var(--black);
  font-weight: 800;
  font-size: 0.72rem;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--edge);
}

.brand {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* App shell */
.app-shell {
  display: flex;
  min-height: calc(100vh - 68px);
}

.sidebar {
  width: 230px;
  background: var(--charcoal);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--charcoal-light);
  border: 2px solid transparent;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 16px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  position: relative;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: #3d3d3d; }
.nav-item.active { border-color: var(--orange); }

.badge {
  margin-left: auto;
  background: var(--orange);
  color: var(--black);
  font-weight: 800;
  font-size: 0.8rem;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* Content */
.content {
  flex: 1;
  padding: 32px;
}

.view { display: none; }
.view.active { display: block; }

.welcome-card {
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 2px;
  padding: 28px 36px;
  margin-bottom: 24px;
}
.welcome-card h1 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 1.6rem;
}
.welcome-card p {
  margin: 0;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 22px 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.stat-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.1rem;
  color: var(--red);
  line-height: 1.1;
}
.stat-label {
  margin-top: 6px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.95rem;
}
@media (max-width: 860px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel-card {
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 2px;
  padding: 24px;
  min-height: 220px;
  margin-bottom: 20px;
}
.panel-card h3 { font-family: var(--font-display); margin-top: 0; }

.recent-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.recent-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--hair);
  padding-bottom: 8px;
  font-weight: 700;
}
.recent-list .muted, .muted { color: var(--muted); font-weight: 500; }

.alerts-panel { border: 3px solid var(--edge); border-radius: 4px; overflow: hidden; }
.alerts-panel-toolbar {
  background: var(--surface-3);
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 3px solid var(--edge);
}
.alerts-panel-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-2);
}
.alerts-panel-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-muted {
  background: #85846f;
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
}
.btn-muted:hover { background: #74735f; }
.alerts-panel-body {
  background: var(--surface);
  padding: 32px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}
.alerts-panel-body .low-stock-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.alerts-panel-body .low-stock-list li {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--hair);
  padding-bottom: 8px;
}
.alerts-panel-body .empty-ok {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-2);
}

.alerts-status-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  background: #2f8f4e;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}
.alerts-status-dot.has-alerts {
  background: var(--red);
  animation: alerts-dot-blink 1.1s ease-in-out infinite;
}
@keyframes alerts-dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.alerts-content { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.alerts-notify-banner {
  background: #fdeeb3;
  border: 2px solid var(--edge);
  border-radius: 6px;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: #6b4a06;
}
.alerts-table-wrap { width: 100%; overflow-x: auto; }
.alerts-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); }
.alerts-table th {
  text-align: left;
  background: #e4f0f6;
  color: #2c5f7c;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--edge);
  white-space: nowrap;
}
.alerts-table td {
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--hair-2);
}
.alerts-table tbody tr:last-child td { border-bottom: none; }
.alerts-table tr.alert-row-critical td { background: #fbd9d7; }
.alerts-table tr.alert-row-warning td { background: #fdf0c0; }
.alerts-status-critical,
.alert-status-critical { color: var(--red); font-weight: 800; }
.alerts-status-warning,
.alert-status-warning { color: #8a6d00; font-weight: 800; }
#view-alerts .alerts-table-wrap { margin-top: 4px; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 20px;
}

.movement-fields-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.movement-fields-row label { flex: 1; min-width: 170px; }

.autocomplete-wrap { position: relative; }
.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 6px 0;
  list-style: none;
  background: var(--charcoal);
  border-radius: 8px;
  z-index: 20;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.suggestions-list li {
  padding: 9px 16px;
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.suggestions-list li:hover, .suggestions-list li.highlighted { background: #3d3d3d; }
.suggestions-list li .suggestion-name { color: #bbb; font-weight: 400; margin-left: 6px; }

#movement-form label, #report-filters-form label, #qrgen-form label, #transfer-form label {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#movement-form input, #movement-form select, #movement-form textarea,
#report-filters-form input, #report-filters-form select, #report-filters-form textarea,
#qrgen-form input, #qrgen-form select,
#transfer-form input, #transfer-form select, #transfer-form textarea {
  font-family: var(--font-body);
  font-weight: 400;
  padding: 10px 12px;
  border: 2px solid var(--hair-2);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--surface);
}
/* #transfer-form ya no usa .movement-fields-row (ver PASO B del flujo de
   traslado): cada campo ocupa su propia fila, igual que en el modal de
   ítem, en vez de la fila densa que tenía antes. */
#transfer-form { display: flex; flex-direction: column; gap: 14px; }

.info-note {
  background: var(--note-bg);
  border: 2px solid var(--orange);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.info-note-icon { font-size: 1.3rem; flex-shrink: 0; }
.info-note p { margin: 0; font-weight: 600; color: var(--text-2); line-height: 1.5; }

/* Calendario de "Fecha" en Movimientos (flatpickr, modo rango para admin /
   modo fecha única para POD) — ajustado a la paleta de la app. */
.flatpickr-alt-input { cursor: pointer; }
.flatpickr-calendar { font-family: var(--font-body); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); border-radius: 10px; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--black);
}
.flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}
.flatpickr-day.inRange {
  background: #fde6bd;
  border-color: #fde6bd;
  box-shadow: -5px 0 0 #fde6bd, 5px 0 0 #fde6bd;
}
.flatpickr-day.today { border-color: var(--orange); }
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-weekdays { background: var(--cream); }
.flatpickr-current-month input.cur-year { font-family: var(--font-body); }

.qr-label {
  background: #fff;
  color: #141414;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  border: 2px dashed #999;
  border-radius: 8px;
  max-width: 280px;
  margin: 8px 0 20px;
}
.qr-label canvas { image-rendering: pixelated; }
.qr-label-text { text-align: center; font-family: var(--font-body); font-size: 0.95rem; line-height: 1.6; }

#print-root { display: none; }

@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 30px;
  }
  body.printing #print-root canvas { image-rendering: pixelated; }
  body.printing #print-root .qr-label-text {
    text-align: center;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
  }
  @page { margin: 10mm; }
}

/* Inventory view */
.inventory-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.location-select-wrap { display: flex; flex-direction: column; gap: 4px; }
.location-select-wrap label { font-weight: 800; font-size: 0.85rem; }
#location-select, .inv-search-wrap input {
  height: 44px;
  padding: 10px 14px;
  border: 2px solid var(--edge);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
  box-sizing: border-box;
}
.inv-search-wrap { flex: 1; min-width: 220px; }
.inv-search-wrap input { width: 100%; }
/* Mismo alto que el select y el buscador — el botón por sí solo (sin
   input/select de por medio) rendeaba 2px más bajo por el font-family
   distinto, generando un desnivel en el borde superior de la barra. */
.inventory-toolbar .btn-secondary,
.inventory-toolbar .btn-primary {
  height: 44px;
  box-sizing: border-box;
}

/* Botón de actualizar (ícono de flechas circulares) junto al selector de
   ubicación — recarga la tabla sin ir al Dashboard ni recargar la página. */
.icon-btn-square {
  height: 44px;
  width: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 6px;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.15s ease;
}
.icon-btn-square:hover:not(:disabled) { background: var(--surface-3); }
.icon-btn-square:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn-square.is-spinning svg { animation: icon-btn-spin 0.6s linear; }
@keyframes icon-btn-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-primary, .btn-secondary, .btn-danger, .btn-success {
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 8px;
  padding: 11px 20px;
  border: 2px solid var(--edge);
  cursor: pointer;
}
.btn-primary { background: var(--orange); color: var(--black); }
.btn-primary:hover:not(:disabled) { background: var(--orange-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); }
.btn-danger { background: var(--red); color: var(--white); border-color: var(--red); margin-right: auto; }
.btn-success { background: #2f8f4e; color: var(--white); border-color: #1e5c32; }
.btn-success:hover:not(:disabled) { background: #26743e; }
.btn-success:disabled { opacity: 0.5; cursor: not-allowed; }

.report-summary {
  background: #e3f3e6;
  border: 2px solid #2f8f4e;
  color: #205c34;
  font-weight: 700;
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 16px;
}

.empty-state {
  background: var(--surface);
  border: 2px dashed #999;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.table-wrap {
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.table-wrap.hidden, .hidden { display: none !important; }

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  border-bottom: 2px solid var(--edge);
  background: var(--surface-2);
}

.inv-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.inv-table th {
  text-align: left;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  padding: 12px 16px;
  font-size: 0.85rem;
}
.inv-table td { padding: 10px 16px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.inv-table tr:last-child td { border-bottom: none; }
.inv-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--hair-2); background: var(--surface-3); display: block; }
.attach-link { color: var(--orange-dark); font-weight: 700; text-decoration: underline; cursor: pointer; background: none; border: none; font-family: var(--font-body); font-size: 0.9rem; padding: 0; }
.qty-low { color: var(--red); font-weight: 800; }
.movement-in { color: #2f8f4e; font-weight: 800; }
.movement-transfer { color: #2563c4; font-weight: 800; }
.row-actions { display: flex; gap: 8px; }
.row-actions button {
  background: none; border: none; cursor: pointer; font-size: 1rem;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-header h2 { font-family: var(--font-display); margin: 0; }
.icon-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

#item-form, .modal form { display: flex; flex-direction: column; gap: 14px; }
#item-form label, .modal form label { font-weight: 700; font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }
#item-form input, #item-form textarea, .modal form input, .modal form textarea, .modal form select {
  font-family: var(--font-body);
  font-weight: 400;
  padding: 10px 12px;
  border: 2px solid var(--hair-2);
  border-radius: 6px;
  font-size: 0.95rem;
}
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row label { flex: 1; min-width: 140px; }
.scan-row { display: flex; gap: 8px; }
.scan-row input { flex: 1; }
.scanner-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#qr-reader, #pod-qr-reader, #bc-qr-reader, #lector-qr-reader, #pod-lector-qr-reader { width: 100%; max-width: 320px; min-height: 200px; }
#pod-qr-reader video, #qr-reader video, #bc-qr-reader video, #lector-qr-reader video, #pod-lector-qr-reader video { max-width: 100%; border-radius: 8px; }
.image-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; border: 2px solid var(--hair-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
  .nav-item span:last-child { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }

  /* El badge de usuario (.profile-menu-wrap) ya no queda pegado al borde
     derecho del topbar cuando este hace wrap en mobile, así que anclar el
     dropdown con "right: 0" lo empujaba fuera de la pantalla por la
     izquierda. Lo anclamos por su propio borde izquierdo en su lugar, y
     le ponemos un ancho máximo de seguridad por si el badge llegara a
     estar más a la derecha. */
  .profile-dropdown {
    right: auto;
    left: 0;
    max-width: calc(100vw - 32px);
  }
}

/* ---------- Modo POD ---------- */
/* El modo POD no usa el sidebar de navegación de administrador — en su
   lugar se mueve entre pantallas con el logo (vuelve a "Estás en..."), el
   selector de ubicación y los tiles de herramientas. */
body.pod-mode .sidebar { display: none; }
body.pod-mode .app-shell { flex-direction: column; }

/* Header apilado: el logo centrado arriba, y debajo alertas + perfil,
   como en el mockup (en vez de todo en una sola fila apretada). */
body.pod-mode .topbar {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 10px;
}
body.pod-mode .topbar .brand { width: 100%; justify-content: center; }
body.pod-mode .topbar-icon-btn { margin-left: 0; }

.pod-heading {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.4rem;
  margin: 26px 0 16px;
}

.pod-field-label { font-weight: 700; display: block; margin-bottom: 10px; }

/* El selector-píldora es la pieza visual central del modo POD: tanto para
   elegir la ubicación la primera vez como para cambiarla después (en
   "Estás en..." cambiar de opción ahí mismo reemplaza el botón aparte que
   había antes). */
.pod-pill-select {
  width: 100%;
  max-width: 420px;
  padding: 16px 44px 16px 20px;
  border: none;
  border-radius: 999px;
  background-color: var(--surface);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='%23141414' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px;
}

/* Banda de sección a todo el ancho, estilo mockup (en vez de un simple
   <h3> dentro del área de contenido). -32px compensa el padding de
   .content para que la banda llegue de borde a borde. */
.pod-band {
  background: var(--charcoal);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 0.95rem;
  padding: 14px 32px;
  margin: 30px -32px 26px;
}
.pod-band-yellow {
  background: var(--orange);
  margin: 0 -32px;
  padding: 30px 32px;
}

.pod-tiles-row { display: flex; gap: 22px; flex-wrap: wrap; }
.pod-tiles-row-center { justify-content: center; }

.pod-tile-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.pod-tile {
  width: 128px;
  height: 128px;
  background: var(--surface);
  border: 3px solid var(--edge);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
}
.pod-tile:hover { background: var(--surface-3); }
.pod-tile svg { width: 54px; height: 54px; }

.pod-tile-small { width: 84px; height: 84px; }
.pod-tile-small svg { width: 36px; height: 36px; }

.pod-tile-label {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
  text-align: center;
  color: var(--ink);
}

/* ---------- Movimientos: hub (Interno / Traslado / En proceso) ----------
   Mismo espíritu que .pod-tile (ícono + etiqueta, fondo blanco, borde negro)
   pero pensado para el layout de escritorio del admin, no para el dedo en
   modo campo: tarjetas más grandes, con el texto adentro de la tarjeta. */
.hub-tiles-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }

.hub-tile {
  width: 176px;
  min-height: 136px;
  background: var(--surface);
  border: 3px solid var(--edge);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 16px;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s ease, transform 0.15s ease;
}
.hub-tile:hover { background: var(--surface-3); transform: translateY(-2px); }
.hub-tile-icon { width: 44px; height: 44px; flex-shrink: 0; }
.hub-tile-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.2px;
  text-align: center;
}

/* ---------- Botón "Volver" dentro de las sub-pantallas de Movimientos ---------- */
.back-link {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-2);
}
.back-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.back-link:hover { color: var(--ink); }

.pod-scan-row {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 24px;
}

.login-card {
  width: 420px;
  max-width: 100%;
  background: var(--black);
  border-radius: 16px;
  padding: 32px 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.login-version { margin: -18px 0 22px; text-align: center; color: #bbb; font-family: var(--font-body); font-weight: 700; font-size: 0.78rem; letter-spacing: .04em; }
.login-title {
  margin: 4px 0 24px;
  text-align: center;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 0.3px;
}

.login-fields {
  background: var(--charcoal);
  border-radius: 10px;
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  margin-top: 10px;
}
.login-label:first-child { margin-top: 0; }

.login-input {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
}
.login-input:focus { box-shadow: 0 0 0 2px var(--orange); }

.login-password-wrap { position: relative; }
.login-password-wrap .login-input { padding-right: 44px; }
.login-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #e39aa8;
  padding: 4px;
  display: flex;
}
.login-eye-btn svg { width: 20px; height: 20px; }
.login-eye-btn.active { color: var(--orange); }

.login-error {
  color: #ff8a80;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 14px 4px 0;
}

.login-success {
  color: #7ddc8c;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 14px 4px 0;
}

.login-submit {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  font-size: 1rem;
}

.login-signup-hint {
  margin: 18px 4px 2px;
  text-align: center;
  color: #bbb;
  font-family: var(--font-body);
  font-size: 0.88rem;
}
.login-signup-hint a { color: var(--orange); font-weight: 700; text-decoration: none; }
.login-signup-hint a:hover { text-decoration: underline; }

/* Wizard de alta vía MasterKey */
.wizard-shell {
  width: 460px;
  max-width: 100%;
  background: var(--black);
  border-radius: 16px;
  padding: 32px 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.wizard-step { display: flex; flex-direction: column; gap: 6px; }

.wizard-panel {
  background: var(--charcoal);
  border-radius: 10px;
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wizard-heading {
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  text-align: center;
  margin: 4px 0 14px;
}
.wizard-heading-inside {
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  margin: 0 0 16px;
  letter-spacing: 0.3px;
}

.wizard-label-standalone {
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 14px;
}
.wizard-label-standalone:first-child { margin-top: 0; }

.wizard-hint {
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 16px 0 6px;
}

.wizard-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wizard-checklist li {
  color: #bbb;
  font-family: var(--font-body);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wizard-checklist li.met { color: #7ddc8c; }
.wizard-checklist li .check-icon { width: 14px; text-align: center; }

.wizard-summary-intro { color: #ccc; font-family: var(--font-body); font-size: 0.9rem; margin: 0 0 14px; }
.wizard-summary-list { display: flex; flex-direction: column; gap: 8px; }
.wizard-summary-list .summary-row {
  display: flex;
  gap: 10px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.92rem;
}
.wizard-summary-list .summary-row dt { font-weight: 700; min-width: 150px; }
.wizard-summary-list .summary-row dd { margin: 0; color: #ddd; word-break: break-word; }

.wizard-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}
.wizard-back-btn {
  background: none;
  border: none;
  color: #bbb;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 4px;
}
.wizard-back-btn:hover { color: var(--white); }
.wizard-cancel-link {
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 0.82rem;
  text-decoration: none;
  margin-right: auto;
}
.wizard-cancel-link:hover { color: #bbb; text-decoration: underline; }
.wizard-next-btn {
  background: var(--white);
  color: var(--ink);
  border: none;
  border-radius: 10px;
  width: 56px;
  height: 56px;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.wizard-next-btn:hover { background: #f0f0f0; }
.wizard-next-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.profile-menu-wrap { position: relative; }

.profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
}
.profile-badge:hover { background: rgba(255, 255, 255, 0.08); }
.profile-badge svg { width: 26px; height: 26px; }
.profile-username {
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
}
.profile-caret {
  width: 16px;
  height: 16px;
  color: var(--white);
  opacity: 0.7;
  transition: transform 0.15s ease;
}
#profile-toggle-btn[aria-expanded="true"] .profile-caret { transform: rotate(180deg); }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
}
.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}
.profile-dropdown-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-2); }
.profile-dropdown-item:hover { background: var(--surface-3); }
.profile-dropdown-item-danger { color: #b3261e; }
.profile-dropdown-item-danger svg { color: #b3261e; }
.profile-dropdown-item-danger:hover { background: #fdecea; }

/* ---------- Configuración ---------- */
.config-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 3px solid var(--edge);
  margin-bottom: 24px;
}

.config-tab {
  background: none;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--ink);
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}
.config-tab:hover { background: rgba(0, 0, 0, 0.06); }
.config-tab.active { background: var(--orange); color: var(--black); }

.config-panel { display: none; }
.config-panel.active { display: block; }

.config-panel-hint {
  color: var(--text-2);
  margin: 0 0 18px;
  font-size: 0.95rem;
}

/* ---------- Movimientos → Traslado: sub-pestañas (mismo look que
   .config-tabs/.config-panel, pero con su propia clase para no quedar
   enganchadas al handler de clic de las pestañas de Configuración) ---------- */
.traslado-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 3px solid var(--edge);
  margin-bottom: 24px;
}
.traslado-tab {
  background: none;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--ink);
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}
.traslado-tab:hover { background: rgba(0, 0, 0, 0.06); }
.traslado-tab.active { background: var(--orange); color: var(--black); }

.traslado-panel { display: none; }
.traslado-panel.active { display: block; }

/* ---------- Movimientos → Traslado → Nuevo traslado: flujo en 2 pasos ---------- */
.transfer-step.hidden { display: none; }

.transfer-destination-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-2);
  border: 2px solid var(--hair);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.transfer-destination-info { display: flex; flex-direction: column; gap: 2px; }
.transfer-destination-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  font-weight: 700;
}
.transfer-destination-info strong { font-family: var(--font-display); font-size: 1.05rem; }

.config-option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 780px;
}

.config-option {
  background: var(--surface);
  border: 2px solid var(--hair);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.config-option strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
}
.config-option p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 0.86rem;
}
.config-option .btn-secondary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .config-option { flex-direction: column; align-items: flex-start; }
}

/* ---------- Configuración: formulario de Fecha y hora ---------- */
.config-form { display: flex; flex-direction: column; gap: 16px; max-width: 420px; }
.config-form label { font-weight: 700; font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }
.config-form input, .config-form select {
  font-family: var(--font-body);
  font-weight: 400;
  padding: 10px 12px;
  border: 2px solid var(--hair-2);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--surface);
}

/* ---------- Configuración: tablas (usuarios / elementos eliminados) ---------- */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 2px solid var(--edge);
  border-radius: 8px;
  margin-top: 16px;
  max-width: 980px;
}
.data-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); background: var(--surface); }
.data-table th {
  text-align: left;
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--edge);
  white-space: nowrap;
}
.data-table td { padding: 10px 14px; font-weight: 600; font-size: 0.92rem; border-bottom: 1px solid var(--hair); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .row-actions { display: flex; gap: 10px; white-space: nowrap; }
.data-table .row-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  line-height: 1;
}
.data-table .role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.data-table .role-badge.role-admin { background: #222; color: var(--white); }
.data-table .role-badge.role-pod { background: var(--orange); color: var(--black); }
.data-table .location-missing { color: var(--red); font-weight: 700; }

/* ---------- Configuración: comparación de roles y permisos ---------- */
.roles-compare { display: flex; gap: 20px; flex-wrap: wrap; max-width: 780px; margin-top: 4px; }
.roles-compare-col {
  flex: 1 1 260px;
  background: var(--surface);
  border: 2px solid var(--hair);
  border-radius: 10px;
  padding: 16px 18px;
}
.roles-compare-col h4 { font-family: var(--font-display); margin: 0 0 10px; font-size: 1rem; }
.roles-compare-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.roles-compare-col li { font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.role-yes { color: #2f8f4e; font-weight: 800; }
.role-no { color: var(--red); font-weight: 800; }

/* ---------- Configuración: contraseña temporal generada ---------- */
.generated-password-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 2px solid var(--edge);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
}
.generated-password-row code {
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
  word-break: break-all;
}

/* ---------- Restaurar ítem: conflicto de código ---------- */
.restore-conflict-box {
  background: var(--note-bg);
  border: 2px solid var(--orange);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: -4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.restore-conflict-box p { margin: 0; font-weight: 700; font-size: 0.9rem; color: var(--text-2); }
.restore-conflict-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  cursor: pointer;
}
.restore-conflict-option input { width: auto; }
.restore-conflict-code-input {
  margin-left: 26px;
  margin-top: -4px;
  width: calc(100% - 26px);
  padding: 8px 10px;
  border: 2px solid var(--orange);
  border-radius: 6px;
  font-size: 0.9rem;
  text-transform: uppercase;
}
.restore-conflict-code-input:disabled {
  background: var(--surface-3);
  color: var(--text-3);
}

/* ---------- Configuración de perfil (modal) ---------- */
.profile-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2px 0 4px;
}

.avatar-option {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 3px;
  border: 3px solid transparent;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.avatar-option img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avatar-option:hover { transform: translateY(-2px); }
.avatar-option.selected { border-color: var(--orange); }

.modal-divider {
  border: none;
  border-top: 2px solid var(--hair);
  margin: 22px 0;
}

.modal-subtitle {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.field-hint {
  margin: -6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.form-message {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
}
.form-message-error { color: #8a1f18; background: #fdecea; }
.form-message-success { color: #1c5e2e; background: #e9f5ec; }

/* ---------- Buscador de zona horaria (Configuración → Fecha y hora) ---------- */
.tz-combo { position: relative; }
.tz-combo input { width: 100%; box-sizing: border-box; }
.tz-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 2px solid var(--hair-2); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.tz-list li { padding: 8px 10px; border-radius: 4px; font-weight: 400; font-size: 0.92rem; cursor: pointer; }
.tz-list li:hover, .tz-list li.active { background: var(--surface-3); }
.tz-list li.selected { font-weight: 700; }
.tz-list li.tz-empty { color: var(--text-3); cursor: default; }
.tz-detect-btn { align-self: flex-start; font-weight: 600; }

/* ---------- Etiquetas (tags) ---------- */
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; margin: 2px 4px 2px 0;
  background: var(--surface-3); border: 1px solid var(--hair-2); border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; color: var(--ink); line-height: 1.5; white-space: nowrap;
}
.tag-chip button {
  background: none; border: none; padding: 0 0 0 2px; cursor: pointer;
  font-size: 0.85rem; line-height: 1; color: var(--text-2);
}
.tag-chip button:hover { color: var(--ink); }
.tag-chip-small { font-size: 0.72rem; padding: 1px 8px; }

.tag-input {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  min-height: 42px; padding: 4px 8px; box-sizing: border-box;
  background: var(--surface); border: 2px solid var(--hair-2); border-radius: 6px; cursor: text;
}
.tag-input:focus-within { border-color: var(--edge); }
.tag-input input {
  flex: 1 1 120px; min-width: 100px; border: none !important; outline: none;
  padding: 6px 4px !important; background: transparent !important; font-size: 0.95rem;
}
.tag-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.9rem; margin-bottom: 14px; }
.tag-field-label .muted { font-weight: 400; font-size: 0.8rem; }

.tag-filter-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.tag-filter { display: flex; flex-direction: column; gap: 4px; flex: 1 1 280px; max-width: 520px; }
.tag-filter-label { font-weight: 700; font-size: 0.82rem; color: var(--text-2); }
.tag-cell { min-width: 120px; }

/* ---------- Topbar: la barra de búsqueda arranca donde empieza el contenido ---------- */
/* El logo ocupa el ancho del menú lateral (230px) más el margen del contenido
   (32px), así el buscador queda alineado con "Menú principal" / los títulos
   y ya no queda montado sobre el logo. */
@media (min-width: 861px) {
  body:not(.pod-mode) .topbar .brand { flex: 0 0 214px; }
}

/* ---------- Buscador general (desplegable) ---------- */
.gs-panel {
  position: absolute; z-index: 60; left: 0; top: calc(100% + 10px);
  width: 100%; min-width: min(560px, 92vw); max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--surface); border: 2px solid var(--edge); border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28); padding: 6px; color: var(--ink);
}
.gs-section {
  padding: 10px 12px 4px; font-family: var(--font-display); font-weight: 800;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
}
.gs-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.gs-row:hover, .gs-row.active { background: var(--surface-3); }
.gs-icon, .gs-thumb {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 9px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
}
.gs-icon { background: var(--charcoal); color: var(--white); }
.gs-icon-soft { background: var(--surface-3); color: var(--edge); border: 1px solid var(--hair-2); }
.gs-icon svg, .gs-thumb svg { width: 20px; height: 20px; }
.gs-thumb { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--hair-2); }
.gs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gs-title { font-weight: 700; font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-sub { font-size: 0.78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-code { font-family: var(--font-display); font-weight: 800; }
.gs-badge {
  flex-shrink: 0; font-size: 0.68rem; font-weight: 700; color: var(--text-2);
  border: 1px solid var(--hair-2); border-radius: 999px; padding: 1px 8px;
}
.gs-tags { flex-shrink: 0; display: flex; max-width: 36%; overflow: hidden; }
.gs-panel mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
.gs-row-all { justify-content: center; }
.gs-row-all .gs-title { color: var(--text-2); text-align: center; }
.gs-note, .gs-hint { padding: 12px 14px; font-size: 0.85rem; color: var(--text-2); }
.gs-hint { font-size: 0.72rem; text-align: center; border-top: 1px solid var(--hair); margin-top: 4px; }
@media (max-width: 860px) {
  .gs-panel { position: fixed; left: 12px; right: 12px; top: auto; width: auto; min-width: 0; margin-top: 10px; }
}

/* ---------- Ubicaciones: pantalla de tarjetas ---------- */
:root { --loc-orange: #f28c1b; --loc-orange-soft: #f8b765; }
.locations-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.locations-toolbar .active { background: var(--black); color: var(--white); }
.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 340px));
  gap: 22px;
  margin-top: 8px;
}
.loc-tile {
  position: relative;
  background: var(--loc-orange);
  border-radius: 14px;
  padding: 12px 14px 14px;
  color: var(--white);
  cursor: pointer;
  text-align: center;
  border: 0;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.loc-tile:hover, .loc-tile:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.25); outline: none; }
.loc-tile-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--white);
}
.loc-tile-img {
  aspect-ratio: 3 / 2;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
}
.loc-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loc-tile-placeholder { width: 56px; height: 56px; color: rgba(255,255,255,.85); }
.loc-tile-placeholder svg { width: 100%; height: 100%; }
.loc-tile-tip {
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translate(-50%, 8px);
  width: 86%;
  background: var(--black);
  color: var(--white);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-size: .88rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 3;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.loc-tile-tip strong { display: block; margin-bottom: 3px; font-family: var(--font-display); }
.loc-tile-tip p { margin: 0 0 6px; white-space: pre-line; max-height: 6.5em; overflow: hidden; }
.loc-tile-tip span { color: var(--orange); font-size: .8rem; font-weight: 700; }
.loc-tile:hover .loc-tile-tip, .loc-tile:focus-visible .loc-tile-tip { opacity: 1; transform: translate(-50%, 0); }
.loc-tile-actions { display: none; gap: 8px; justify-content: center; }
.loc-tile-actions button { flex: 1; }
.locations-grid.is-managing .loc-tile-actions { display: flex; }
.locations-grid.is-managing .loc-tile { cursor: default; }
.locations-grid.is-managing .loc-tile:hover { transform: none; }
.locations-grid.is-managing .loc-tile-tip { display: none; }
.loc-tile-add {
  background: var(--loc-orange-soft);
  justify-content: center;
  align-items: center;
  min-height: 200px;
  border: 2px dashed rgba(255,255,255,.8);
  box-shadow: none;
}
.loc-add-circle {
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--white); color: var(--loc-orange);
  font-size: 3rem; font-weight: 700; line-height: 78px;
}
.locations-grid.is-managing .loc-tile-add { display: none; }
#location-image-preview { max-width: 100%; max-height: 180px; border-radius: 8px; display: block; margin: 6px 0; }
@media (max-width: 600px) { .locations-grid { grid-template-columns: 1fr; } }

/* ---------- Configuración → Usuarios: todo en una sola columna alineada ---------- */
.config-stack { max-width: 980px; display: flex; flex-direction: column; gap: 16px; }
.config-stack .config-panel-hint { margin: 0; }
.config-stack .config-option { width: 100%; }
.config-stack .data-table-wrap { margin-top: 0; max-width: none; }
.config-subtitle { font-family: var(--font-display); font-size: 1.15rem; margin: 14px 0 0; }
.config-subtext { margin: -8px 0 0; color: var(--text-2); font-size: 0.92rem; line-height: 1.55; max-width: 780px; }
.config-stack .roles-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: none; margin-top: 0;
}
.roles-compare-col h4 { display: flex; align-items: center; gap: 10px; }
.roles-compare-col .role-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.7rem;
  font-weight: 800; text-transform: uppercase; font-family: var(--font-body);
}
.roles-compare-col .role-badge.role-admin { background: #222; color: var(--white); }
.roles-compare-col .role-badge.role-pod { background: var(--orange); color: var(--black); }
.roles-desc { margin: 0 0 12px; font-size: 0.86rem; color: var(--text-2); line-height: 1.45; padding-bottom: 12px; border-bottom: 1px solid var(--hair); }
.roles-compare-col li { align-items: flex-start; }
@media (max-width: 860px) { .config-stack .roles-compare { grid-template-columns: 1fr; } }

/* ---------- Movimientos → Temporal ---------- */
.temporal-toolbar { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.temporal-toolbar .info-note { flex: 1 1 520px; margin-bottom: 16px; }
.temporal-toolbar > .btn-secondary { flex-shrink: 0; }
.info-note-list { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 0.92rem; line-height: 1.5; }
.info-note-body { flex: 1; }

/* ---------- Alertas: botón "＋ Ingreso" y bloque "en movimiento" ---------- */
.alert-action-cell { text-align: right; white-space: nowrap; }
.alert-ingreso-btn {
  font: inherit; font-size: 0.78rem; font-weight: 800; padding: 4px 10px;
  border: 2px solid var(--edge); border-radius: 6px; background: var(--surface);
  color: var(--ink); cursor: pointer;
}
.alert-ingreso-btn:hover { background: var(--orange); }
.motion-box { margin-top: 16px; border: 2px solid #3b7bbf; border-radius: 8px; overflow: hidden; background: var(--surface); }
.motion-banner {
  background: #dcebfa; color: #1d4a7a; font-family: var(--font-display); font-weight: 800;
  padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.motion-banner-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.motion-list { list-style: none; margin: 0; padding: 6px 16px 10px; }
.motion-list li { padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 0.9rem; }
.motion-list li:last-child { border-bottom: none; }
.motion-tag { display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-right: 8px; }
.motion-tag-internal { background: #dcebfa; color: #1d4a7a; }
.motion-tag-external { background: #fde3c4; color: #8a4b05; }

/* ---------- Configuración → Notificaciones ---------- */
.notif-status { border: 2px solid var(--hair); border-radius: 10px; padding: 14px 18px; background: var(--surface); font-size: 0.92rem; line-height: 1.5; }
.notif-status-ok { border-color: #2f8f4e; background: #eef8f1; }
.notif-status-warn { border-color: var(--orange); background: var(--note-bg); }
.notif-status code { background: rgba(0,0,0,.07); padding: 1px 6px; border-radius: 4px; }
.notif-card { background: var(--surface); border: 2px solid var(--hair); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.notif-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.notif-check input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--orange-dark); }
.notif-check strong { display: block; font-family: var(--font-display); }
.notif-check small { display: block; color: var(--text-2); font-size: 0.84rem; line-height: 1.4; margin-top: 2px; }
.notif-time { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.9rem; max-width: 220px; margin-left: 30px; }
.notif-time input { font: inherit; font-weight: 400; padding: 8px 10px; border: 2px solid var(--hair-2); border-radius: 6px; }
.notif-recipients { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.notif-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.notif-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.notif-pill-enviado { background: #dff3e5; color: #1c5e2e; }
.notif-pill-error { background: #fdecea; color: #8a1f18; }
.notif-pill-omitido { background: var(--surface-3); color: var(--text-2); }
.notif-pill-registrado { background: var(--surface-3); color: var(--text-2); }
.notif-pill-pendiente { background: #fdf0c0; color: #8a6100; }
.notif-pill-apagado { background: #fdecea; color: #8a1f18; }
.notif-time-wide { max-width: 480px; } .notif-time-wide small { font-weight: 400; line-height: 1.35; }
.notif-time-wide input[type="number"] { max-width: 110px; }
.row-lock { cursor: help; opacity: .65; padding: 0 6px; }
.locations-reorder-hint { margin: 0 0 10px; font-size: .85rem; }
.loc-tile { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.loc-tile.is-dragging { position: relative; z-index: 20; cursor: grabbing; box-shadow: 0 14px 28px rgba(0,0,0,.35); transition: none; opacity: .95; }
.locations-grid.is-reordering { cursor: grabbing; }
.locations-grid.is-reordering .loc-tile:not(.is-dragging) { transition: none; }
.locations-grid.is-reordering .loc-tile-tip { display: none; }

/* =====================================================================
   MODO OSCURO — "sacristía de noche"
   No es el claro invertido: el crema pasa a café muy oscuro, el texto a
   crema cálido y el naranja de la marca se mantiene como único acento.
   Se activa con <html data-theme="dark"> (Configuración → Modos, o el
   botón del menú de perfil). El claro sigue siendo el valor por defecto.
   ===================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --cream: #17130e;
  --ink: #f3ead2;
  --muted: #b3a78b;
  --surface: #231d15;
  --surface-2: #1d1812;
  --surface-3: #2f271c;
  --note-bg: #30271a;
  --hair: #342b1e;
  --hair-2: #51442e;
  --edge: #6d5c3c;
  --text-2: #d3c6a6;
  --text-3: #a09375;
  --charcoal: #1f1a13;
  --charcoal-light: #2b241a;
  --orange: #f4ad42;
}
html[data-theme="dark"] body { background: var(--cream); color: var(--ink); }
html[data-theme="dark"] .topbar { background: #0d0a07; border-bottom: 1px solid #2c2418; }
html[data-theme="dark"] .sidebar { border-right: 1px solid #2c2418; }
html[data-theme="dark"] .topbar-icon-btn:hover,
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .suggestions-list li:hover,
html[data-theme="dark"] .suggestions-list li.highlighted { background: #3b3122; }
html[data-theme="dark"] .search-wrap { background: var(--surface); border: 1px solid var(--hair-2); }
html[data-theme="dark"] .search-wrap input { color: var(--ink); background: transparent; }
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not(.login-input):not(#global-search),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { color: var(--ink); background-color: var(--surface-2); }
html[data-theme="dark"] .tag-input input, html[data-theme="dark"] .tz-combo input { background-color: transparent; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--text-3); }
/* El campo del login tiene fondo claro también en modo oscuro: el texto debe ser oscuro. */
html[data-theme="dark"] .login-input { background: #fff; color: #1b1712; caret-color: #1b1712; }
html[data-theme="dark"] .login-input::placeholder { color: #8a8174; }
html[data-theme="dark"] .login-input:-webkit-autofill { -webkit-text-fill-color: #1b1712; box-shadow: 0 0 0 40px #fff inset; }
html[data-theme="dark"] .stat-card { border: 1px solid var(--hair-2); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
html[data-theme="dark"] .modal-overlay { background: rgba(6, 4, 2, 0.72); }
html[data-theme="dark"] .modal { border: 1px solid var(--hair-2); }
html[data-theme="dark"] .btn-muted { background: #5d5948; }
html[data-theme="dark"] .btn-muted:hover { background: #6d6955; }
html[data-theme="dark"] .alerts-notify-banner { background: #3a2f12; color: #f1da8e; }
html[data-theme="dark"] .alerts-table th { background: #1f3340; color: #a9d0e6; }
html[data-theme="dark"] .alerts-table tr.alert-row-critical td { background: #4a2220; }
html[data-theme="dark"] .alerts-table tr.alert-row-warning td { background: #43371a; }
html[data-theme="dark"] .alert-status-warning { color: #f3c64e; }
html[data-theme="dark"] .report-summary { background: #17301f; border-color: #3f9a62; color: #a5e0b9; }
html[data-theme="dark"] .movement-in, html[data-theme="dark"] .role-yes { color: #62d48d; }
html[data-theme="dark"] .movement-transfer { color: #82adf0; }
html[data-theme="dark"] .profile-dropdown-item-danger,
html[data-theme="dark"] .profile-dropdown-item-danger svg { color: #ff8f86; }
html[data-theme="dark"] .profile-dropdown-item-danger:hover { background: #3b201d; }
html[data-theme="dark"] .profile-dropdown-item:hover { background: var(--surface-3); }
html[data-theme="dark"] .profile-dropdown { border: 1px solid var(--hair-2); }
html[data-theme="dark"] .config-tab:hover,
html[data-theme="dark"] .traslado-tab:hover { background: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .data-table .role-badge.role-admin,
html[data-theme="dark"] .roles-compare-col .role-badge.role-admin { background: #0d0a07; border: 1px solid var(--hair-2); }
html[data-theme="dark"] .form-message-error { color: #ffb0a8; background: #3d201d; }
html[data-theme="dark"] .form-message-success { color: #a9e5bc; background: #17301f; }
html[data-theme="dark"] .gs-panel mark { background: #6c5412; color: #fff2c2; }
html[data-theme="dark"] .gs-panel { border-color: var(--hair-2); }
html[data-theme="dark"] .motion-banner, html[data-theme="dark"] .motion-tag-internal { background: #1c3047; color: #acd0f2; }
html[data-theme="dark"] .motion-tag-external { background: #47321b; color: #f4c991; }
html[data-theme="dark"] .notif-status-ok { background: #17301f; }
html[data-theme="dark"] .notif-status-warn { background: var(--note-bg); }
html[data-theme="dark"] .notif-status code { background: rgba(255,255,255,.1); }
html[data-theme="dark"] .notif-pill-enviado { background: #1d3a27; color: #a5e0b9; }
html[data-theme="dark"] .notif-pill-error, html[data-theme="dark"] .notif-pill-apagado { background: #3d201d; color: #ffb0a8; }
html[data-theme="dark"] .notif-pill-pendiente { background: #43371a; color: #f3d37a; }
html[data-theme="dark"] .info-note { border-color: #7a6030; }
html[data-theme="dark"] .tz-list { border-color: var(--hair-2); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
html[data-theme="dark"] .pod-tile:hover, html[data-theme="dark"] .hub-tile:hover { background: var(--surface-3); }
/* Calendario (flatpickr) */
html[data-theme="dark"] .flatpickr-calendar { background: var(--surface); color: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.55); border: 1px solid var(--hair-2); }
html[data-theme="dark"] .flatpickr-calendar:before, html[data-theme="dark"] .flatpickr-calendar:after { border-bottom-color: var(--surface); border-top-color: var(--surface); }
html[data-theme="dark"] .flatpickr-months .flatpickr-month,
html[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
html[data-theme="dark"] .flatpickr-weekdays,
html[data-theme="dark"] span.flatpickr-weekday { background: var(--surface); color: var(--text-2); }
html[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { background: var(--surface); }
html[data-theme="dark"] .flatpickr-day { color: var(--ink); }
html[data-theme="dark"] .flatpickr-day:hover { background: var(--surface-3); border-color: var(--surface-3); }
html[data-theme="dark"] .flatpickr-day.prevMonthDay, html[data-theme="dark"] .flatpickr-day.nextMonthDay,
html[data-theme="dark"] .flatpickr-day.flatpickr-disabled { color: var(--text-3); opacity: .55; }
html[data-theme="dark"] .flatpickr-day.selected { background: var(--orange); border-color: var(--orange); color: #141414; }
html[data-theme="dark"] .flatpickr-months .flatpickr-prev-month svg, html[data-theme="dark"] .flatpickr-months .flatpickr-next-month svg { fill: var(--ink); }
html[data-theme="dark"] .flatpickr-months .flatpickr-prev-month:hover svg, html[data-theme="dark"] .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--orange); }
html[data-theme="dark"] .flatpickr-day.inRange { background: #3d311d; border-color: #3d311d; box-shadow: -5px 0 0 #3d311d, 5px 0 0 #3d311d; }
/* Las fotos no se oscurecen; solo se les baja un poco el brillo para que no deslumbren */
html[data-theme="dark"] .inv-thumb, html[data-theme="dark"] .gs-thumb img, html[data-theme="dark"] .loc-tile-img img { filter: brightness(.92); }

/* Selector de apariencia (Configuración → Modos) */
.theme-choices { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.theme-choice {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface); border: 2px solid var(--hair-2); border-radius: 12px;
  padding: 10px 12px 8px; cursor: pointer; font-family: var(--font-display); font-weight: 700;
  color: var(--ink); min-width: 104px;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.theme-choice:hover { transform: translateY(-2px); border-color: var(--orange); }
.theme-choice[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,169,59,.35); }
.theme-swatch {
  width: 84px; height: 54px; border-radius: 8px; border: 2px solid #141414; overflow: hidden;
  display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 12px 1fr;
}
.theme-swatch i { display: block; }
.theme-swatch .sw-top { grid-column: 1 / -1; }
.theme-swatch-light { background: #fbf3d3; } .theme-swatch-light .sw-top { background: #141414; } .theme-swatch-light .sw-side { background: #2a2a2a; } .theme-swatch-light .sw-card { background: #fff; margin: 5px; border-radius: 4px; }
.theme-swatch-dark { background: #17130e; } .theme-swatch-dark .sw-top { background: #0d0a07; } .theme-swatch-dark .sw-side { background: #1f1a13; } .theme-swatch-dark .sw-card { background: #231d15; margin: 5px; border-radius: 4px; border: 1px solid #51442e; }
.theme-swatch-auto { background: linear-gradient(90deg, #fbf3d3 50%, #17130e 50%); }
.theme-swatch-auto .sw-top { background: linear-gradient(90deg, #141414 50%, #0d0a07 50%); }
.theme-swatch-auto .sw-side { background: linear-gradient(90deg, #2a2a2a 100%, #2a2a2a 0); width: 22px; }
.theme-swatch-auto .sw-card { background: linear-gradient(90deg, #fff 30%, #231d15 30%); margin: 5px; border-radius: 4px; }
.theme-note { font-size: .85rem; color: var(--text-2); margin: 10px 0 0; }

/* =====================================================================
   MOVIMIENTO
   Una sola idea: al cambiar de pantalla el contenido se asienta (sube un
   poco y se aclara) y las tarjetas, atajos y ubicaciones entran en cascada,
   una tras otra, como se van ordenando las cosas en una sacristía. Lo demás
   responde a lo que haces: ventanas que se abren, menús que se despliegan,
   botones que se hunden al presionar, íconos que reaccionan.
   Todo se apaga con "reducir movimiento" del sistema.
   ===================================================================== */
:root {
  --ease-out: cubic-bezier(.22, .8, .24, 1);
  --ease-spring: cubic-bezier(.2, .9, .3, 1.25);
}
@keyframes ki-view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ki-rise    { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ki-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes ki-pop     { from { opacity: 0; transform: translateY(12px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes ki-drop    { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ki-icon-pop { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.3) rotate(-10deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes ki-badge-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ki-sun-in  { from { transform: rotate(-70deg) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }

/* Cambio de pantalla */
.view.active { animation: ki-view-in .3s var(--ease-out) backwards; }
.view.is-entering .stat-card, .view.is-entering .panel-card, .view.is-entering .hub-tile,
.view.is-entering .pod-tile-wrap, .view.is-entering .loc-tile, .view.is-entering .config-option,
.view.is-entering .alerts-panel, .view.is-entering .locations-toolbar { animation: ki-rise .46s var(--ease-out) backwards; }
.view.is-entering .panel-card:nth-child(2), .view.is-entering .alerts-panel { animation-delay: 120ms; }
.view.is-entering .stats-grid > :nth-child(1) { animation-delay: 80ms; }
.view.is-entering .stats-grid > :nth-child(2) { animation-delay: 135ms; }
.view.is-entering .stats-grid > :nth-child(3) { animation-delay: 190ms; }
.view.is-entering .stats-grid > :nth-child(4) { animation-delay: 245ms; }
.view.is-entering .stats-grid > :nth-child(5) { animation-delay: 300ms; }
.view.is-entering .stats-grid > :nth-child(6) { animation-delay: 355ms; }
.view.is-entering .stats-grid > :nth-child(7) { animation-delay: 410ms; }
.view.is-entering .stats-grid > :nth-child(8) { animation-delay: 465ms; }
.view.is-entering .stats-grid > :nth-child(9) { animation-delay: 520ms; }
.view.is-entering .stats-grid > :nth-child(10) { animation-delay: 575ms; }
.view.is-entering .stats-grid > :nth-child(11) { animation-delay: 630ms; }
.view.is-entering .stats-grid > :nth-child(12) { animation-delay: 685ms; }
.view.is-entering .locations-grid > :nth-child(1) { animation-delay: 80ms; }
.view.is-entering .locations-grid > :nth-child(2) { animation-delay: 135ms; }
.view.is-entering .locations-grid > :nth-child(3) { animation-delay: 190ms; }
.view.is-entering .locations-grid > :nth-child(4) { animation-delay: 245ms; }
.view.is-entering .locations-grid > :nth-child(5) { animation-delay: 300ms; }
.view.is-entering .locations-grid > :nth-child(6) { animation-delay: 355ms; }
.view.is-entering .locations-grid > :nth-child(7) { animation-delay: 410ms; }
.view.is-entering .locations-grid > :nth-child(8) { animation-delay: 465ms; }
.view.is-entering .locations-grid > :nth-child(9) { animation-delay: 520ms; }
.view.is-entering .locations-grid > :nth-child(10) { animation-delay: 575ms; }
.view.is-entering .locations-grid > :nth-child(11) { animation-delay: 630ms; }
.view.is-entering .locations-grid > :nth-child(12) { animation-delay: 685ms; }
.view.is-entering .hub-tiles-row > :nth-child(1) { animation-delay: 80ms; }
.view.is-entering .hub-tiles-row > :nth-child(2) { animation-delay: 135ms; }
.view.is-entering .hub-tiles-row > :nth-child(3) { animation-delay: 190ms; }
.view.is-entering .hub-tiles-row > :nth-child(4) { animation-delay: 245ms; }
.view.is-entering .hub-tiles-row > :nth-child(5) { animation-delay: 300ms; }
.view.is-entering .hub-tiles-row > :nth-child(6) { animation-delay: 355ms; }
.view.is-entering .hub-tiles-row > :nth-child(7) { animation-delay: 410ms; }
.view.is-entering .hub-tiles-row > :nth-child(8) { animation-delay: 465ms; }
.view.is-entering .hub-tiles-row > :nth-child(9) { animation-delay: 520ms; }
.view.is-entering .hub-tiles-row > :nth-child(10) { animation-delay: 575ms; }
.view.is-entering .hub-tiles-row > :nth-child(11) { animation-delay: 630ms; }
.view.is-entering .hub-tiles-row > :nth-child(12) { animation-delay: 685ms; }
.view.is-entering .pod-tiles-row > :nth-child(1) { animation-delay: 80ms; }
.view.is-entering .pod-tiles-row > :nth-child(2) { animation-delay: 135ms; }
.view.is-entering .pod-tiles-row > :nth-child(3) { animation-delay: 190ms; }
.view.is-entering .pod-tiles-row > :nth-child(4) { animation-delay: 245ms; }
.view.is-entering .pod-tiles-row > :nth-child(5) { animation-delay: 300ms; }
.view.is-entering .pod-tiles-row > :nth-child(6) { animation-delay: 355ms; }
.view.is-entering .pod-tiles-row > :nth-child(7) { animation-delay: 410ms; }
.view.is-entering .pod-tiles-row > :nth-child(8) { animation-delay: 465ms; }
.view.is-entering .pod-tiles-row > :nth-child(9) { animation-delay: 520ms; }
.view.is-entering .pod-tiles-row > :nth-child(10) { animation-delay: 575ms; }
.view.is-entering .pod-tiles-row > :nth-child(11) { animation-delay: 630ms; }
.view.is-entering .pod-tiles-row > :nth-child(12) { animation-delay: 685ms; }
.view.is-entering .config-option-list > :nth-child(1) { animation-delay: 80ms; }
.view.is-entering .config-option-list > :nth-child(2) { animation-delay: 135ms; }
.view.is-entering .config-option-list > :nth-child(3) { animation-delay: 190ms; }
.view.is-entering .config-option-list > :nth-child(4) { animation-delay: 245ms; }
.view.is-entering .config-option-list > :nth-child(5) { animation-delay: 300ms; }
.view.is-entering .config-option-list > :nth-child(6) { animation-delay: 355ms; }
.view.is-entering .config-option-list > :nth-child(7) { animation-delay: 410ms; }
.view.is-entering .config-option-list > :nth-child(8) { animation-delay: 465ms; }
.view.is-entering .config-option-list > :nth-child(9) { animation-delay: 520ms; }
.view.is-entering .config-option-list > :nth-child(10) { animation-delay: 575ms; }
.view.is-entering .config-option-list > :nth-child(11) { animation-delay: 630ms; }
.view.is-entering .config-option-list > :nth-child(12) { animation-delay: 685ms; }

/* Entrada a la app tras iniciar sesión */
#app-shell:not(.hidden), #topbar:not(.hidden) { animation: ki-fade .4s ease backwards; }
.login-screen:not(.hidden) .login-card { animation: ki-pop .5s var(--ease-out) backwards; }

/* Ventanas, menús y paneles que se abren */
.modal-overlay:not(.hidden) { animation: ki-fade .18s ease backwards; }
.modal-overlay:not(.hidden) > * { animation: ki-pop .3s var(--ease-spring) backwards; }
.profile-dropdown:not(.hidden), .gs-panel:not(.hidden), .suggestions-list:not(.hidden), .tz-list:not(.hidden) { animation: ki-drop .16s var(--ease-out) backwards; transform-origin: top center; }

/* Respuesta al tacto y al cursor */
.btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-muted, .icon-btn-square, .nav-item,
.hub-tile, .pod-tile, .topbar-icon-btn, .config-tab, .traslado-tab, .alert-ingreso-btn, .wizard-next-btn {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .16s var(--ease-out), box-shadow .18s ease;
}
.btn-primary:active:not(:disabled), .btn-secondary:active:not(:disabled), .btn-danger:active:not(:disabled),
.btn-success:active:not(:disabled), .btn-muted:active:not(:disabled), .icon-btn-square:active:not(:disabled),
.nav-item:active, .hub-tile:active, .pod-tile:active, .topbar-icon-btn:active, .alert-ingreso-btn:active,
.wizard-next-btn:active { transform: scale(.96); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 0 rgba(0,0,0,.25); transform: translateY(-1px); }
.nav-item svg, .hub-tile svg, .pod-tile svg { transition: transform .22s var(--ease-spring); }
.nav-item:hover svg { transform: translateX(2px) scale(1.08); }
.hub-tile:hover svg, .pod-tile:hover svg { transform: translateY(-3px) scale(1.08); }
.nav-item.nav-pop svg { animation: ki-icon-pop .45s var(--ease-spring); }
.badge:not(.hidden) { animation: ki-badge-pop .35s var(--ease-spring) backwards; }
.stat-card { transition: transform .2s var(--ease-out), box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-3px); }
.inv-table tbody tr, .data-table tbody tr, .alerts-table tbody tr { transition: background-color .15s ease; }
.inv-table tbody tr:hover td { background: var(--surface-2); }
.profile-dropdown-item svg { transition: transform .2s var(--ease-spring); }
.profile-dropdown-item:hover svg { transform: scale(1.12); }

/* Interruptor claro/oscuro: muestra el ícono del modo al que se cambiaría */
#theme-toggle-btn .theme-icon-sun { display: none; }
#theme-toggle-btn.is-dark .theme-icon-moon { display: none; }
#theme-toggle-btn.is-dark .theme-icon-sun { display: block; animation: ki-sun-in .45s var(--ease-spring); }
html:not(.theme-fading) #theme-toggle-btn .theme-icon-moon { animation: none; }

/* Cambio de tema: los colores se funden en vez de saltar */
html.theme-fading *, html.theme-fading *::before, html.theme-fading *::after {
  transition: background-color .38s ease, color .38s ease, border-color .38s ease, box-shadow .38s ease, fill .38s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html[data-theme="dark"] .alert-status-critical, html[data-theme="dark"] .qty-low { color: #ff8478; }
html[data-theme="dark"] .alerts-table tr.alert-row-warning td, html[data-theme="dark"] .alerts-table tr.alert-row-critical td { border-bottom-color: rgba(255,255,255,.08); }

/* La barra superior (con sus menús desplegables) siempre por encima del contenido */
.topbar { position: relative; z-index: 50; }
#pod-scanner-wrap { margin: 18px 0 90px; }


/* ---------- Beta 1.1.0 · Modo POD: ingresar ítem / añadir existencias ---------- */
#view-pod-ingreso .pod-tiles-row { margin-top: 8px; }
#view-pod-ingreso .form-message { margin-bottom: 18px; }

.pod-stock-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.pod-stock-toolbar-text { display: flex; flex-direction: column; gap: 2px; }
.pod-stock-search {
  flex: 1 1 220px; min-width: 180px; padding: 10px 12px;
  border: 2px solid var(--edge); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit;
}
#pod-stock-error { margin-bottom: 12px; }
#pod-stock-qr-reader { width: 100%; max-width: 360px; min-height: 240px; }
#pod-stock-scanner-wrap { margin: 6px 0 18px; }
.pod-stock-wrap { width: 100%; overflow-x: auto; }
.pod-stock-table tbody tr { cursor: pointer; }
.pod-stock-table tbody tr:hover { background: var(--surface-3); }
.pod-stock-table .btn-primary { padding: 6px 12px; font-size: 0.8rem; }
.pod-stock-table td.qty-low { font-weight: 800; }

.stockin-summary { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.stockin-summary strong { font-family: var(--font-display); font-size: 1.1rem; }

/* etiquetas definidas por el administrador: visibles pero sin botón de quitar */
.tag-chip-locked { background: var(--note-bg); }
.tag-chip-locked::before { content: "🔒"; font-size: 0.65rem; opacity: .7; }

/* Formulario de ítem en modo POD: dos botones de foto en vez del input de archivo */
.pod-photo-actions { display: none; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.modal.pod-item-mode #item-form label.image-field-label { display: none; }
.modal.pod-item-mode .pod-photo-actions { display: flex; }
.pod-photo-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.pod-photo-buttons .btn-secondary { flex: 1 1 180px; padding: 12px; }

.camera-modal { max-width: 520px; }
.camera-stage { display: flex; justify-content: center; background: #000; border-radius: 8px; overflow: hidden; }
.camera-stage-inner { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
#camera-video { display: block; max-width: 100%; max-height: 60vh; background: #000; }
/* marco guía: el objeto debe quedar dentro; el centro queda despejado */
.camera-frame { position: absolute; inset: 12% 10%; border: 2px dashed rgba(255,255,255,.55); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0,0,0,.28); pointer-events: none; }
.camera-frame i { position: absolute; width: 26px; height: 26px; border: 4px solid #f7a93a; }
.camera-frame i:nth-child(1) { top: -4px; left: -4px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.camera-frame i:nth-child(2) { top: -4px; right: -4px; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.camera-frame i:nth-child(3) { bottom: -4px; left: -4px; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.camera-frame i:nth-child(4) { bottom: -4px; right: -4px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.camera-hint { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; color: #fff; font: 700 0.78rem/1.2 var(--font-body); text-shadow: 0 1px 3px #000; pointer-events: none; }


.pod-stock-table td, .pod-stock-table th { padding-left: 10px; padding-right: 10px; }
.pod-stock-table .row-chevron { text-align: right; font-size: 1.3rem; font-weight: 800; color: var(--text-3); width: 1%; }
.scan-row input { min-width: 0; flex: 1 1 auto; }
.scan-row .btn-secondary { flex: 0 0 auto; padding-left: 10px; padding-right: 10px; }
@media (max-width: 480px) { .scan-row .btn-secondary { font-size: 0.78rem; } }

/* ---------- Beta 1.1.0 · Modo POD: movimientos, miniaturas, «Usando» ---------- */
.pick-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--hair-2); background: var(--surface-3); display: block; }
.pick-thumb-lg { width: 56px; height: 56px; border-radius: 8px; flex: 0 0 auto; }
.pick-thumb-cell { width: 1%; padding-right: 0 !important; }
.stockin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stockin-head .stockin-summary { margin-bottom: 0; min-width: 0; }

.pod-ext-dest-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pod-ext-dest {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left;
  padding: 14px 16px; background: var(--surface); color: var(--ink); border: 3px solid var(--edge); border-radius: 10px; cursor: pointer; font: inherit;
}
.pod-ext-dest:hover { background: var(--surface-3); }
.pod-ext-dest strong { font-family: var(--font-display); font-size: 1.02rem; }
.pod-ext-dest .muted { grid-column: 1; font-size: 0.82rem; }
.pod-ext-dest .row-chevron { grid-column: 2; grid-row: 1 / span 2; font-size: 1.6rem; font-weight: 800; color: var(--text-3); }
.pod-ext-add { width: 100%; padding: 14px; }
.podext-dest { margin-bottom: 12px; padding: 8px 12px; background: var(--note-bg); border-radius: 8px; font-size: 0.9rem; }

#view-pod-movimientos .form-message { margin-bottom: 18px; line-height: 1.4; }
#view-pod-movimientos .form-message a { color: inherit; font-weight: 800; text-decoration: underline; }

.motion-tag-using { background: #e3f3e1; color: #1f5a22; }
html[data-theme="dark"] .motion-tag-using { background: #1b3a1f; color: #a9e5ae; }
#movement-responsible-field { flex: 1; min-width: 200px; }
.motion-list li { overflow-wrap: anywhere; }

/* ---------- Beta 1.1.2 · QRGen «Más detalles» ---------- */
.qrgen-more-btn { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 12px; padding: 6px 2px; background: none; border: 0; color: var(--ink); font: 800 0.9rem var(--font-body); cursor: pointer; }
.qrgen-more-chevron { display: inline-block; transition: transform .2s ease; }
.qrgen-more-btn[aria-expanded="true"] .qrgen-more-chevron { transform: rotate(180deg); }
.qrgen-more-panel { margin-bottom: 14px; padding: 14px; background: var(--note-bg); border-radius: 8px; animation: ki-fade .2s ease backwards; }
#qrgen-preview-extra:empty { display: none; }
.qrgen-more-panel label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.9rem; }
.qrgen-more-panel input[type="number"], .qrgen-more-panel select { padding: 10px 12px; border: 2px solid var(--edge); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.qrgen-more-panel .field-row { margin-top: 12px; }


/* ---- Formularios más ordenados: rejilla de 2 columnas (ítem, QRGen, traslado interno) ---- */
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.field-grid > label { min-width: 0; }
.field-grid input, .field-grid select { width: 100%; box-sizing: border-box; }
.check-card {
  align-self: end;
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  min-height: 42px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 2px solid var(--hair-2);
  border-radius: 6px;
  cursor: pointer;
  background: var(--surface);
}
.check-card input[type="checkbox"] { width: 20px !important; height: 20px; margin: 0; padding: 0; flex: none; accent-color: var(--accent, #f0a830); cursor: pointer; }
.check-card-text { display: flex; flex-direction: column; gap: 2px; font-weight: 700; font-size: 0.9rem; }
.field-hint { grid-column: 1 / -1; margin: -4px 0 0; font-size: 0.8rem; line-height: 1.35; color: var(--muted); font-weight: 400; }
.check-card:has(input:checked) { border-color: var(--edge); background: var(--surface-3); }
label.is-disabled { opacity: .5; }
@media (max-width: 420px) { .field-grid { grid-template-columns: minmax(0, 1fr); } }

.movement-dest-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 4px; }
.movement-dest-grid.hidden { display: none; }
.movement-dest-grid > label { min-width: 0; }
.movement-dest-grid input, .movement-dest-grid select { width: 100%; box-sizing: border-box; }
.movement-dest-hint { grid-column: 1 / -1; margin-top: -6px; font-size: 0.85rem; }
.movement-dest-hint:empty { display: none; }
@media (max-width: 640px) { .movement-dest-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Avisos 💡 plegables: una línea visible y el detalle al hacer clic ---- */
.info-note-fold { display: block; padding: 0; }
.info-note-fold > summary {
  list-style: none;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 600; color: var(--text-2); line-height: 1.5;
}
.info-note-fold > summary::-webkit-details-marker { display: none; }
.info-note-sum { flex: 1; min-width: 0; }
.info-note-more {
  flex-shrink: 0; font-size: 0.82rem; font-weight: 700; white-space: nowrap;
  padding: 4px 10px; border: 1.5px solid var(--orange); border-radius: 999px;
}
.info-note-more::after { content: " ▾"; }
.info-note-fold[open] .info-note-more::after { content: " ▴"; }
.info-note-fold[open] .info-note-more { background: rgba(240,168,48,.18); }
.info-note-fold > summary:focus-visible { outline: 2px solid var(--edge); outline-offset: -4px; border-radius: 8px; }
.info-note-fold > .info-note-list, .info-note-fold > .info-note-text { margin: 0; padding: 0 20px 16px 52px; list-style: disc; }
.info-note-fold > .info-note-list li { margin-top: 6px; }
.info-note-fold > .info-note-text { padding-left: 52px; color: var(--text-2); font-size: 0.92rem; line-height: 1.5; }
.info-note-fold > .info-note-text p { margin: 6px 0 0; font-weight: 400; }
@media (max-width: 520px) {
  .info-note-fold > summary { flex-wrap: wrap; row-gap: 6px; }
  .info-note-fold > .info-note-list, .info-note-fold > .info-note-text { padding-left: 38px; }
}

/* ---------- Beta 1.2.1 · QR por ítem, visor e Historial de QR ---------- */
.qr-cell { width: 64px; }
.qr-thumb-btn {
  display: inline-flex; padding: 3px; background: #fff; border: 2px solid var(--hair-2);
  border-radius: 6px; cursor: zoom-in; line-height: 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
.qr-thumb-btn:hover { transform: scale(1.06); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.qr-thumb-btn:focus-visible { outline: 2px solid var(--edge); outline-offset: 2px; }
.qr-thumb { width: 44px; height: 44px; image-rendering: pixelated; background: #fff; display: block; }

.qr-viewer { max-width: 420px; text-align: center; }
.qr-viewer-img { width: 300px; height: 300px; max-width: 100%; image-rendering: pixelated; background: #fff; border: 2px solid var(--hair-2); border-radius: 8px; padding: 6px; box-sizing: border-box; }
.qr-viewer-info { margin: 14px 0; text-align: left; display: grid; gap: 4px; }
.qr-viewer-info > div { display: flex; gap: 8px; }
.qr-viewer-info dt { font-weight: 800; min-width: 92px; color: var(--text-2); }
.qr-viewer-info dd { margin: 0; overflow-wrap: anywhere; }

.qrhist-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.qrhist-head h3 { margin: 0 0 8px; }
.qrhist-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.qrhist-toolbar input[type="search"] {
  flex: 1 1 260px; min-width: 0; padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 6px;
  font-family: var(--font-body); font-size: 0.95rem; background: var(--surface); color: inherit;
}
.qrhist-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.qrhist-filter {
  padding: 8px 12px; border: 2px solid var(--hair-2); border-radius: 999px; background: var(--surface);
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; cursor: pointer; color: inherit;
}
.qrhist-filter.is-active { background: var(--edge); color: var(--white); border-color: var(--edge); }
.qrhist-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.qrhist-selectall { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9rem; cursor: pointer; margin-right: auto; }
.qrhist-table td { vertical-align: middle; }
.qrhist-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent, #f0a830); }
.qrhist-chip { display: inline-block; padding: 2px 8px; margin: 0 4px 4px 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--hair-2); font-size: 0.78rem; }
.qrhist-more { text-align: center; margin-top: 12px; }
html[data-theme="dark"] .qr-thumb-btn, html[data-theme="dark"] .qr-viewer-img { background: #fff; border-color: #6b5a3a; }

/* Hoja de etiquetas al imprimir (una o varias) */
@media print {
  body.printing #print-root.print-sheet {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6mm;
    align-items: start;
    padding-top: 0;
  }
  body.printing #print-root.print-sheet.is-single { grid-template-columns: 1fr; justify-items: center; padding-top: 30px; }
  body.printing #print-root .print-label {
    border: 1px dashed #888; padding: 4mm; display: flex; flex-direction: column; align-items: center;
    gap: 2mm; text-align: center; break-inside: avoid; page-break-inside: avoid;
    font-family: var(--font-body); font-size: 10pt; line-height: 1.35; color: #000;
  }
  body.printing #print-root .print-label img { width: 38mm; height: 38mm; image-rendering: pixelated; }
  body.printing #print-root .print-label-text { overflow-wrap: anywhere; }
  body.printing #print-root.is-single .print-label { border: none; }
  body.printing #print-root.is-single .print-label img { width: 55mm; height: 55mm; }
  body.printing #print-root.is-single .print-label { font-size: 12pt; }
}
@media (max-width: 640px) {
  .qrhist-table th:nth-child(7), .qrhist-table td:nth-child(7) { display: none; }
}
#qrgen-pane-history .data-table-wrap { max-width: none; margin-top: 0; }

/* Aviso bajo el campo de código (máx. 10 caracteres, letras/números/guiones) */
.code-hint { display: block; margin-top: 4px; color: var(--red); font-size: 0.8rem; }
.code-hint.hidden { display: none; }
input.input-invalid { box-shadow: 0 0 0 2px var(--red); }

/* Marcas «Nuevo» / «Modificado» en historial y reportes */
.movement-new { color: #1b7f3b; font-weight: 700; }
.movement-edited { color: #a8620a; font-weight: 700; }
html[data-theme="dark"] .movement-new { color: #5fd38a; }
html[data-theme="dark"] .movement-edited { color: #f0b45a; }

/* Botones «Actualizar» */
.toolbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-refresh .refresh-icon { display: inline-block; font-size: 1.05em; line-height: 1; }
.btn-refresh.is-loading .refresh-icon { animation: refresh-spin .8s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-refresh.is-loading .refresh-icon { animation: none; } }


/* Existencias del código, encima del formulario de Movimientos */
.stock-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 12px 16px; margin: 0 0 16px;
  border: 2px solid var(--edge); border-radius: 10px; background: var(--surface-2, rgba(0,0,0,.04)); }
.stock-banner.hidden { display: none; }
.stock-banner-main { font-size: 1rem; }
.stock-banner-qty { font-size: 1.05rem; }
.stock-banner-qty strong { font-size: 1.25rem; color: var(--orange); }
.stock-banner-note { flex-basis: 100%; font-size: .88rem; color: var(--text-3, #7a6f60); }

/* Botón «Sugerir código» y brillo del campo cuando se rellena solo */
.scan-row { flex-wrap: wrap; }
.suggest-btn[disabled] { opacity: .55; cursor: not-allowed; }
.suggest-hint { margin: -6px 0 12px; }
.suggest-hint.is-error { color: var(--red); }
@keyframes field-flash {
  0%   { background-color: #fff176; box-shadow: 0 0 0 4px rgba(255, 214, 10, .65), 0 0 18px 4px rgba(255, 214, 10, .6); }
  100% { box-shadow: 0 0 0 0 rgba(255, 214, 10, 0), 0 0 0 0 rgba(255, 214, 10, 0); }
}
.field-flash { animation: field-flash 1.8s ease-out; }
html[data-theme="dark"] .field-flash { color: #1b1712; }
@media (prefers-reduced-motion: reduce) { .field-flash { animation-duration: .01s; } }

/* Filas clicables de la tabla de ítems + ficha de lectura */
.inv-row-clickable { cursor: pointer; }
.inv-row-clickable:hover td { background: var(--surface-2, rgba(0,0,0,.04)); }
.inv-row-clickable:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.item-detail-card { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 28px; align-items: start; }
.item-detail-media { display: flex; flex-direction: column; gap: 8px; }
.item-detail-frame { position: relative; aspect-ratio: 1 / 1; width: 100%; border: 2px solid var(--edge); border-radius: 14px;
  background: #fff; display: grid; place-items: center; overflow: hidden; }
.item-detail-pic { width: 100%; height: 100%; object-fit: contain; display: block; }
.item-detail-qrpic { padding: 14px; box-sizing: border-box; image-rendering: pixelated; }
.item-detail-noimage { color: #7a6f60; font-weight: 600; }
.item-detail-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--edge); background: rgba(255,255,255,.92); color: #1b1712; font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.item-detail-arrow:hover { background: var(--orange); color: #fff; }
.item-detail-arrow.is-prev { left: 8px; }
.item-detail-arrow.is-next { right: 8px; }
.item-detail-arrow.hidden, .item-detail-pic.hidden, .item-detail-noimage.hidden { display: none; }
.item-detail-caption { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; color: var(--text-3, #7a6f60); }
.item-detail-full.hidden { display: none; }
.item-detail-data { margin: 0; display: grid; gap: 0; }
.item-detail-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair-2, rgba(0,0,0,.1)); }
.item-detail-row dt { font-weight: 700; color: var(--text-3, #7a6f60); }
.item-detail-row dd { margin: 0; word-break: break-word; }
@media (max-width: 760px) {
  .item-detail-card { grid-template-columns: 1fr; }
  .item-detail-row { grid-template-columns: 120px 1fr; }
}

/* ---------- Beta 1.3.1 · Dashboard: lo más visitado ---------- */
.visit-panel { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 24px; }
.visit-title { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; }
.visit-list { display: flex; gap: 12px; flex-wrap: wrap; }
.visit-chip { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; background: var(--surface); border: 2px solid var(--edge); border-radius: 999px; color: inherit; cursor: pointer; font: inherit; transition: transform .15s ease, background .15s ease; }
.visit-chip:hover { background: var(--surface-3); transform: translateY(-1px); }
.visit-chip-icon { width: 24px; height: 24px; display: inline-flex; flex-shrink: 0; }
.visit-chip-icon svg { width: 100%; height: 100%; }
.visit-chip-text { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.visit-chip-text small { color: var(--muted, #6b6b6b); font-size: 0.75rem; }

.docs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.docs-head h3 { margin: 0; }
.doc-thumb { width: 54px; height: 54px; object-fit: cover; border: 2px solid var(--edge); border-radius: 6px; display: block; background: var(--surface-3); }
.doc-pdf-badge { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border: 2px solid var(--edge); border-radius: 6px; font-weight: 800; background: var(--surface-3); }
.doc-open { text-decoration: none; display: inline-block; padding: 4px 10px; }

/* ---------- Beta 1.4.0 · Diálogos propios ---------- */
.app-dialog-overlay { z-index: 400; }
.app-dialog { max-width: 440px; padding: 26px 28px 22px; border: 2px solid var(--edge); border-radius: 10px; }
.app-dialog-title { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 10px; }
.app-dialog-msg { margin: 0 0 22px; line-height: 1.5; white-space: pre-line; }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.app-dialog-actions .btn-primary.is-danger { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Beta 1.4.0 · Ojito de contraseña ---------- */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > input { width: 100%; box-sizing: border-box; padding-right: 44px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; border-radius: 6px; color: var(--muted); cursor: pointer; padding: 0; }
.pw-eye:hover { color: var(--edge); background: var(--surface-3); }
.pw-eye:focus-visible { outline: 2px solid var(--loc-orange, #f28c1b); outline-offset: 1px; }
.pw-eye svg { width: 20px; height: 20px; }

/* ---------- Beta 1.4.0 · Movimientos → Usar ---------- */
.usar-tab { font-family: var(--font-display); font-weight: 800; font-size: 0.9rem; text-transform: uppercase; letter-spacing: .03em; background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 16px; cursor: pointer; color: inherit; }
.usar-tab.active { background: var(--orange); border-radius: 8px 8px 0 0; }
.usar-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--edge); color: #fff; font-size: 0.75rem; text-align: center; }
.usar-panel { display: none; }
.usar-panel.active { display: block; }
.usar-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.usar-toolbar input[type=search] { flex: 1; min-width: 200px; padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 6px; font-size: 0.95rem; }
.usar-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 2px solid var(--edge); display: block; }
.usar-form-card { max-width: 560px; }
.usar-form-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.usar-form-head h2 { margin: 0 0 2px; font-family: var(--font-display); }
.usar-form-head p { margin: 0; }
.usar-form-img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid var(--edge); }
#usar-form { display: flex; flex-direction: column; gap: 14px; }
#usar-form label { font-weight: 700; font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }
#usar-form input, #usar-form select, #usar-form textarea { font-family: var(--font-body); font-weight: 400; padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 6px; font-size: 0.95rem; }
.usar-method-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.usar-method { background: var(--surface-3); border: 2px solid var(--edge); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; color: inherit; }
.usar-method.active { background: var(--orange); }
.usar-method-panel { display: none; }
.usar-method-panel.active { display: block; }
#usar-return-qr-reader { width: 100%; max-width: 320px; margin: 8px 0; }
.usar-method-panel label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; margin-bottom: 12px; }
.usar-method-panel input, .usar-method-panel textarea { padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 6px; font: inherit; font-weight: 400; }

/* ---------- Beta 1.4.0 · Reloj de Fecha y hora ---------- */
.clock-card { display: flex; align-items: center; gap: 18px; padding: 18px 22px; margin: 4px 0 20px; background: var(--edge); color: #fff; border-radius: 14px; max-width: 560px; border: 2px solid var(--edge); }
html[data-theme="dark"] .clock-card { background: #14100b; border-color: var(--orange); }
.clock-icon { width: 46px; height: 46px; flex-shrink: 0; color: var(--orange); }
.clock-icon svg { width: 100%; height: 100%; }
.clock-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.clock-label { font-size: 0.75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); font-weight: 800; }
.clock-time { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.clock-date { text-transform: capitalize; font-size: 0.95rem; }
.clock-zone { font-size: 0.8rem; opacity: .75; }

/* ---------- Beta 1.4.0 · Reportes ---------- */
.report-lead { margin: -6px 0 18px; color: var(--muted); font-weight: 600; }
.report-filters { padding: 22px 24px; }
.report-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.report-quick-label { font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 4px; }
.report-chip { font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--edge); background: var(--surface); color: inherit; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.report-chip:hover { background: var(--surface-3); transform: translateY(-1px); }
.report-chip.active { background: var(--orange); }
.report-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.report-fields label { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.report-fields input, .report-fields select { font-family: var(--font-body); font-weight: 600; padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 8px; font-size: 0.95rem; background: var(--surface); color: inherit; }
.report-fields input:focus, .report-fields select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242, 169, 59, .3); }
.report-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.report-summary { display: flex; flex-wrap: wrap; gap: 12px; background: none; border: none; padding: 0; margin: 0 0 16px; }
.report-stat { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; }
.report-stat strong { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }
.report-stat span { font-weight: 700; font-size: 0.85rem; }
.report-stat-total { background: var(--edge); color: #fff; }
.type-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-weight: 800; font-size: 0.78rem; letter-spacing: .02em; border: 1.5px solid currentColor; white-space: nowrap; }
.type-in { color: #1e7a3f; background: #e3f3e6; }
.type-out { color: #b3261e; background: #fbe4e1; }
.type-move { color: #2563c4; background: #e3edfb; }
.type-use { color: #8a4fc7; background: #efe6fa; }
.type-edit { color: #a8620a; background: #fdf0d6; }
.type-other { color: #555; background: #eee; }
html[data-theme="dark"] .type-in { color: #62d48d; background: #17301f; }
html[data-theme="dark"] .type-out { color: #ff8478; background: #3d201d; }
html[data-theme="dark"] .type-move { color: #82adf0; background: #1b2840; }
html[data-theme="dark"] .type-use { color: #c9a2f2; background: #2b1f3a; }
html[data-theme="dark"] .type-edit { color: #f0b660; background: #3a2b12; }
html[data-theme="dark"] .type-other { color: #bbb; background: #2a2a2a; }
html[data-theme="dark"] .report-stat-total { background: #14100b; border-color: var(--orange); }
.report-table-wrap { border-radius: 14px; }
.report-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .06em; position: sticky; top: 0; }
.report-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
.report-table tbody tr:hover td { background: color-mix(in srgb, var(--orange) 14%, transparent); }
.report-table td.num { font-family: var(--font-display); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.report-table th:nth-child(6) { text-align: right; }
.report-obs { max-width: 360px; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 760px) { .report-fields { grid-template-columns: 1fr; } }

/* ---------- Switch "Simular modo POD" (admin) ---------- */
.sim-switch {
  position: relative; flex: 0 0 auto;
  width: 78px; height: 40px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #3a3a3a 0%, #1c1c1c 100%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08);
  transition: background .3s ease, box-shadow .3s ease;
  margin-right: 10px;
}
.sim-switch.hidden { display: none; }
.sim-switch:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.sim-switch.on {
  background: linear-gradient(135deg, #ffd27a 0%, var(--orange) 55%, #e0701f 100%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.25), 0 0 14px rgba(242,169,59,.55);
}
.sim-switch-knob {
  position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.4);
  transition: transform .3s cubic-bezier(.4,1.4,.5,1);
}
.sim-switch.on .sim-switch-knob { transform: translateX(38px); }
.sim-switch-ico { position: absolute; top: 4px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; z-index: 1; transition: opacity .2s ease; }
.sim-switch-ico svg { width: 19px; height: 19px; }
.sim-ico-user { left: 4px; color: #1c1c1c; opacity: 1; }
.sim-ico-rocket { right: 4px; color: #1c1c1c; opacity: 0; }
.sim-switch.on .sim-ico-user { opacity: 0; }
.sim-switch.on .sim-ico-rocket { opacity: 1; left: auto; transform: translateX(-32px); }
.sim-switch:not(.on) .sim-ico-rocket { color: rgba(255,255,255,.35); opacity: 1; }
.sim-switch.on .sim-ico-rocket { right: 4px; transform: none; color: #fff; }
.sim-switch.on .sim-ico-rocket { color: #1c1c1c; opacity: 1; transform: none; }
.sim-switch:not(.on) .sim-ico-user { color: #1c1c1c; }

/* ---------- 1.4.1: botones de tabla con aspecto de botón y alineados ---------- */
.data-table td.row-actions { display: table-cell; white-space: nowrap; text-align: right; vertical-align: middle; }
.data-table td.row-actions > * + * { margin-left: 8px; }
.usar-action-cell { text-align: right; vertical-align: middle; white-space: nowrap; }
.tbl-btn, .data-table .row-actions .tbl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px;
  font: inherit; font-size: 0.85rem; font-weight: 800; line-height: 1; text-decoration: none; cursor: pointer;
  color: var(--black); background: var(--white);
  border: 2px solid var(--black); border-radius: 8px;
  box-shadow: 0 2px 0 var(--black);
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.tbl-btn:hover:not(:disabled), .data-table .row-actions .tbl-btn:hover:not(:disabled) { background: #f4efe3; transform: translateY(-1px); box-shadow: 0 3px 0 var(--black); }
.tbl-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 0 0 var(--black); }
.tbl-btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.tbl-btn:disabled { opacity: .45; cursor: not-allowed; }
.tbl-btn-primary, .data-table .row-actions .tbl-btn-primary { background: var(--orange); }
.tbl-btn-primary:hover:not(:disabled), .data-table .row-actions .tbl-btn-primary:hover:not(:disabled) { background: var(--orange-dark); }
.tbl-btn-ok, .data-table .row-actions .tbl-btn-ok { background: #2e9e57; color: #fff; border-color: #14532d; box-shadow: 0 2px 0 #14532d; min-width: 38px; font-size: 1.05rem; }
.tbl-btn-ok:hover:not(:disabled), .data-table .row-actions .tbl-btn-ok:hover:not(:disabled) { background: #268a4b; box-shadow: 0 3px 0 #14532d; }
.tbl-btn-no, .data-table .row-actions .tbl-btn-no { background: #d93a3a; color: #fff; border-color: #7f1d1d; box-shadow: 0 2px 0 #7f1d1d; min-width: 38px; font-size: 1.05rem; }
.tbl-btn-no:hover:not(:disabled), .data-table .row-actions .tbl-btn-no:hover:not(:disabled) { background: #bf2f2f; box-shadow: 0 3px 0 #7f1d1d; }
.usar-tags, .suggestion-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.suggestion-tags { display: inline-flex; margin: 0 0 0 8px; }
.suggestion-tag { font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #f4e3c0; color: #5a3d00; border: 1px solid #e4c88a; }

/* ---------- 1.4.1: términos y condiciones del alta + correo precargado ---------- */
.terms-box { max-height: 320px; overflow-y: auto; padding: 14px 16px; border: 2px solid var(--black); border-radius: 10px; background: #fff; font-size: 0.88rem; line-height: 1.5; text-align: left; }
.terms-box h3 { margin: 14px 0 4px; font-size: 0.95rem; }
.terms-box p { margin: 0 0 6px; }
.terms-meta { color: #6b6b6b; font-size: 0.78rem; font-style: italic; }
.terms-accept { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-weight: 700; cursor: pointer; text-align: left; }
.terms-accept input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orange-dark); flex: 0 0 auto; }
.login-input.prefilled-glow { box-shadow: 0 0 0 3px var(--orange), 0 0 16px rgba(242,169,59,.7); background: #fff6e0; }
.setup-email-note { margin: 6px 0 0; font-size: 0.82rem; font-weight: 700; color: #7a4b00; }
#setup-screen .terms-accept { color: #fff; }
#setup-screen .setup-email-note { color: #ffd27a; }

/* ---------- 1.4.1: pie de la barra lateral, «Acerca de» y acuerdo más grande ---------- */
.sidebar-footer {
  margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: rgba(255,255,255,.75);
}
.sidebar-footer-logo { width: 44px; height: 44px; margin-bottom: 4px; }
.sidebar-footer-name { color: #fff; font-family: var(--font-display); font-size: 1rem; }
.sidebar-footer-version { color: var(--orange); font-weight: 800; font-size: 0.8rem; letter-spacing: .04em; }
.sidebar-footer-dev { font-size: 0.72rem; line-height: 1.45; }
.sidebar-footer-dev strong { color: #fff; }

.about-card { background: var(--white); border: 2px solid var(--black); border-radius: var(--radius); padding: 28px; max-width: 980px; }
.about-logos { display: flex; gap: 36px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.about-logos figure { margin: 0; text-align: center; }
.about-logos img { width: 112px; height: 112px; display: block; margin: 0 auto 6px; }
.about-logos figcaption { font-weight: 800; font-size: 0.85rem; }
.about-title { text-align: center; margin: 6px 0 2px; font-size: 1.7rem; }
.about-tagline { text-align: center; margin: 0 0 22px; color: #555; font-weight: 600; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.about-grid section { border: 2px solid var(--hair, #e6dfcc); border-radius: 12px; padding: 16px 18px; background: #fffdf7; }
.about-grid h3 { margin: 0 0 10px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: .05em; color: #7a4b00; }
.about-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 0.9rem; }
.about-dl dt { font-weight: 800; }
.about-dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.about-credits { margin: 0; font-size: 0.86rem; line-height: 1.55; font-weight: 600; }
.about-actions { display: flex; gap: 14px; align-items: center; margin-top: 20px; }
.about-note { margin: 12px 0 0; font-size: 0.8rem; color: #6b6b6b; }
.about-terms-modal { width: min(820px, 94vw); max-width: none; }
.terms-box-modal { max-height: 68vh; }

/* Acuerdo del alta: tarjeta más ancha y cuadro de lectura más alto y grande */
.wizard-shell.wizard-wide { max-width: 860px; width: 94vw; }
.wizard-shell.wizard-wide .terms-box { max-height: 58vh; min-height: 340px; font-size: 1rem; line-height: 1.6; padding: 18px 22px; }
.wizard-shell.wizard-wide .terms-box h3 { font-size: 1.05rem; }
.wizard-shell.wizard-wide .terms-accept { font-size: 1rem; }
.about-logos img { border-radius: 18px; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.about-logos figure:first-child img { border-radius: 50%; }
.about-logos img { width: 132px; height: 132px; }

/* Botón del wizard: misma fuente del sitio y versión ancha para «Crear cuenta» */
.wizard-next-btn { font-family: inherit; display: inline-flex; align-items: center; justify-content: center; }
.wizard-next-btn.wizard-next-create { width: auto; min-width: 150px; padding: 0 24px; font-size: 1.05rem; font-weight: 800; background: var(--orange); color: var(--black); white-space: nowrap; }
.wizard-next-btn.wizard-next-create:hover:not(:disabled) { background: var(--orange-dark); }

/* ---------- 1.4.1: Dashboard con saludo compacto + reloj ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 20px; margin-bottom: 24px; align-items: stretch; }
.dash-top .welcome-card { margin-bottom: 0; padding: 18px 26px; display: flex; flex-direction: column; justify-content: center; }
.dash-top .welcome-card h1 { font-size: 1.35rem; margin-bottom: 4px; }
.dash-top .welcome-card p { font-size: 1.05rem; }
.clock-card.clock-card-dash { margin: 0; max-width: none; padding: 14px 22px; }
.clock-card-dash .clock-time { font-size: 2.1rem; }
@media (max-width: 820px) { .dash-top { grid-template-columns: 1fr; } }
.clock-date { text-transform: none; }
.clock-date::first-letter { text-transform: uppercase; }

/* ---------- 1.4.1: filtros del resumen de Reportes y pie del modo POD ---------- */
button.report-stat { font: inherit; color: inherit; cursor: pointer; text-align: left; transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease; }
button.report-stat.report-stat-total { color: #fff; }
button.report-stat:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--edge); }
button.report-stat:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
button.report-stat.is-selected { background: var(--orange); border-color: var(--black); box-shadow: 0 3px 0 var(--black); color: var(--black); }
button.report-stat.is-selected .type-badge { background: #fff; }
button.report-stat.report-stat-total.is-selected { background: var(--edge); color: #fff; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange); }
html[data-theme="dark"] button.report-stat.is-selected:not(.report-stat-total) { color: #14100b; }

body.pod-mode .content { display: flex; flex-direction: column; min-height: calc(100vh - 118px); }
.pod-footer { margin-top: auto; padding: 36px 8px 8px; text-align: center; font-size: 0.8rem; line-height: 1.6; color: #6b6b6b; }
.pod-footer strong { color: var(--black); }
.pod-footer .pod-footer-version { color: #7a4b00; font-weight: 800; }
html[data-theme="dark"] .pod-footer strong { color: #fff; }

/* ---------- Beta 1.4.1 · Móvil: info de la build al final + más visitados compactos ---------- */
@media (max-width: 860px) {
  .sidebar-footer { display: none !important; }
  .pod-footer.hidden { display: block !important; }
  .content { display: flex; flex-direction: column; min-height: calc(100vh - 118px); }
  .visit-panel { gap: 8px; }
  .visit-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .visit-chip { padding: 6px 10px 6px 8px; gap: 6px; min-width: 0; }
  .visit-chip-icon { width: 18px; height: 18px; }
  .visit-chip-text { min-width: 0; font-size: 0.8rem; }
  .visit-chip-text span, .visit-chip-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .visit-chip-text small { font-size: 0.66rem; }
}

/* ---------- Beta 1.4.1 · Pie de página: franja negra a todo el ancho ---------- */
.pod-footer {
  margin: auto -32px -32px;
  padding: 16px 16px 18px;
  background: #0f0f0f;
  color: #cfcfcf;
  border-top: 3px solid var(--orange);
  font-size: 0.8rem;
}
.pod-footer strong { color: #fff; }
.pod-footer .pod-footer-version { color: var(--orange); }
html[data-theme="dark"] .pod-footer { background: #000; }
.content > .view { margin-bottom: 24px; }
body.pod-mode .content { box-sizing: border-box; min-height: calc(100vh - 108px); padding-bottom: 32px; }
@media (max-width: 860px) { .content { box-sizing: border-box; } }
body.pod-mode .content { padding-bottom: 0; }
.pod-footer { margin-bottom: 0; }
@media (max-width: 860px) { .content { padding-bottom: 0; } }
body.pod-mode .app-shell { min-height: 0; }

/* Beta 1.4.1 · El reloj del Dashboard solo se ve en escritorio */
@media (max-width: 860px) { #dash-clock { display: none !important; } }

/* ---------- 1.4.2: menú lateral fijo (solo escritorio) ---------- */
@media (min-width: 861px) {
  /* Beta 1.4.4: la barra superior (logo + buscador) queda fija arriba; el menú lateral se pega justo debajo */
  body:not(.pod-mode) .topbar { position: sticky; top: 0; z-index: 50; }
  body:not(.pod-mode) .sidebar {
    position: sticky; top: var(--topbar-h, 68px); align-self: flex-start;
    height: calc(100vh - var(--topbar-h, 68px)); overflow-y: auto; box-sizing: border-box;
  }
}

/* ---------- 1.4.2: modo POD, tablas que caben en la pantalla del teléfono ---------- */
body.pod-mode .inv-table { min-width: 0; table-layout: fixed; }
body.pod-mode .data-table-wrap, body.pod-mode .pod-stock-wrap { overflow-x: hidden; max-width: 100%; }
body.pod-mode .data-table { table-layout: fixed; }
body.pod-mode .data-table th, body.pod-mode .data-table td { padding: 8px 8px; font-size: 0.85rem; word-break: break-word; overflow-wrap: anywhere; white-space: normal; }
body.pod-mode .data-table th { font-size: 0.7rem; }
body.pod-mode .usar-col-loc, body.pod-mode .usar-col-act, body.pod-mode .usar-col-since { display: none; }
body.pod-mode .usar-row-tap { cursor: pointer; }
body.pod-mode .usar-row-tap:active td { background: var(--surface-3); }
body.pod-mode #usar-panel-usar .data-table th:first-child, body.pod-mode #usar-panel-usar .data-table td:first-child { width: 56px; }
body.pod-mode #usar-panel-usar .data-table th:nth-child(4), body.pod-mode #usar-panel-usar .data-table td:nth-child(4) { width: 78px; text-align: center; }
body.pod-mode #usar-panel-devolver .data-table td:last-child { width: 96px; }
body.pod-mode #usar-panel-devolver .tbl-btn { font-size: 0.72rem; padding: 6px 8px; }
body.pod-mode .pod-stock-table th:first-child, body.pod-mode .pod-stock-table td:first-child { width: 52px; }
body.pod-mode .pod-stock-table th:nth-child(2), body.pod-mode .pod-stock-table td:nth-child(2) { width: 24%; word-break: break-word; }
body.pod-mode .pod-stock-table th:nth-child(4), body.pod-mode .pod-stock-table td:nth-child(4) { width: 22%; }
body.pod-mode .pod-stock-table th:last-child, body.pod-mode .pod-stock-table td:last-child { width: 24px; }

/* ---------- 1.4.2: escáner de zona del POD con animación (baja el visor, se abre la cámara) ---------- */
body.pod-mode .scanner-wrap.is-open {
  position: fixed; inset: 0; z-index: 900; margin: 0; padding: 24px 16px;
  background: #000; justify-content: center; gap: 18px;
  animation: podScanDown .35s ease-out both;
}
body.pod-mode .scanner-wrap.is-open::before {
  content: attr(data-scan-title); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; text-align: center;
}
body.pod-mode .scanner-wrap.is-open.is-closing { animation: podScanUp .3s ease-in both; }
body.pod-mode .scanner-wrap.is-open > div[id$="qr-reader"] { max-width: 420px; background: #111; border-radius: 12px; overflow: hidden; }
body.pod-scanning { overflow: hidden; }
@keyframes podScanDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes podScanUp { from { transform: translateY(0); } to { transform: translateY(-100%); } }

/* ficha de ítem en el teléfono (POD) */
body.pod-mode .item-detail-card { grid-template-columns: 1fr; gap: 16px; padding: 14px; }
body.pod-mode .item-detail-frame { max-width: 280px; margin: 0 auto; }
body.pod-mode .item-detail-row { grid-template-columns: 105px 1fr; font-size: .9rem; }
body.pod-mode #item-detail-back-2 { width: 100%; }

/* ---------- 1.4.2: aviso de transferencia interna ---------- */
.motion-tag-transfer { background: #d9ecff; color: #0b4a84; }
html[data-theme="dark"] .motion-tag-transfer { background: #1b3552; color: #a9d2f7; }
.motion-dismiss-btn { margin-left: 8px; padding: 3px 10px; font-size: .78rem; }
#movement-mode-field select { width: 100%; }

/* 1.4.2: ajuste fino de tablas del POD (sin cortar códigos ni encabezados) */
body.pod-mode #view-usar .panel-card { padding: 14px 12px; }
body.pod-mode .data-table th, body.pod-mode .data-table td,
body.pod-mode .pod-stock-table th, body.pod-mode .pod-stock-table td { word-break: normal; overflow-wrap: break-word; hyphens: none; }
body.pod-mode #usar-panel-usar .data-table th:first-child, body.pod-mode #usar-panel-usar .data-table td:first-child { width: 50px; padding-left: 4px; padding-right: 4px; }
body.pod-mode #usar-panel-usar .data-table th:nth-child(2), body.pod-mode #usar-panel-usar .data-table td:nth-child(2) { width: 27%; font-size: .78rem; }
body.pod-mode #usar-panel-usar .data-table th:nth-child(4), body.pod-mode #usar-panel-usar .data-table td:nth-child(4) { width: 52px; }
body.pod-mode .pod-stock-table th:nth-child(2), body.pod-mode .pod-stock-table td:nth-child(2) { width: 29%; font-size: .8rem; word-break: normal; }
body.pod-mode .pod-stock-table th:nth-child(4), body.pod-mode .pod-stock-table td:nth-child(4) { width: 20%; }

/* 1.4.2: cantidad bloqueada mientras se elige «Transferencia» (se define en el formulario siguiente) */
#movement-quantity-field.is-disabled { opacity: .55; }
#movement-quantity:disabled { background: var(--surface-3); color: var(--text-3, #7a6f60); cursor: not-allowed; }

/* el visor de «Usar → devolver» vive dentro de una ventana: solo se ve cuando está abierto */
.scanner-inline:not(.is-open) { display: none; }
body:not(.pod-mode) .scanner-inline:not(.is-open) { display: none; }
body:not(.pod-mode) .scanner-inline.is-open { display: flex; }
.scan-overlay-close { align-self: center; }
body.pod-mode .scanner-wrap.is-open { z-index: 1200; }
body.pod-mode .scanner-wrap.is-open { margin: 0 !important; }

/* ---------- 1.4.3: logo Duoc UC en «Acerca de» ---------- */
.about-logos figure.about-logo-wide img { width: 250px; height: auto; border-radius: 0; box-shadow: none; max-width: 100%; }
.about-logos figure.about-logo-wide { align-self: center; }

/* ---------- 1.4.3: tiempo de sesión activa ---------- */
.session-settings-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.session-check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.session-minutes { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.session-minutes input { width: 84px; }
.session-minutes input:disabled { opacity: .5; cursor: not-allowed; }
.idle-overlay { z-index: 5000; }
.idle-modal { text-align: center; max-width: 380px; }
.idle-modal h2 { margin: 0 0 6px; font-family: var(--font-display); }
.idle-modal p { margin: 4px 0; }
.idle-count { font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; line-height: 1.1; color: var(--orange); }
.idle-actions { justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.idle-actions .btn-primary, .idle-actions .btn-secondary { min-width: 140px; }
.login-info { background: #e8f1fb; color: #0b4a84; border: 2px solid #3b7bbf; border-radius: 8px; padding: 8px 12px; font-weight: 700; }

/* 1.4.3: logo de Duoc UC en el espacio libre de «Acerca de» (el logo ya lleva el nombre, sin texto debajo) */
.about-grid .about-duoc { display: flex; align-items: center; justify-content: center; padding: 8px; }
.about-grid .about-duoc img { width: 250px; max-width: 100%; height: auto; }

/* 1.4.3: «Acerca de» y el acuerdo de licencia en modo oscuro */
html[data-theme="dark"] .about-card { background: var(--surface); border-color: var(--hair-2); color: var(--ink); }
html[data-theme="dark"] .about-tagline { color: var(--text-2); }
html[data-theme="dark"] .about-grid section { background: var(--surface-2); border-color: var(--hair-2); }
html[data-theme="dark"] .about-grid h3 { color: var(--orange); }
html[data-theme="dark"] .about-note { color: var(--text-3); }
html[data-theme="dark"] .about-logos img { box-shadow: 0 2px 0 rgba(0,0,0,.5); }
/* El logo de Duoc UC es de letras oscuras sobre transparente: va sobre una placa clara para que se lea */
html[data-theme="dark"] .about-grid .about-duoc img { background: #fffdf7; padding: 14px 20px; border-radius: 14px; box-sizing: content-box; width: 220px; }
html[data-theme="dark"] .terms-box { background: var(--surface-2); color: var(--ink); border-color: var(--hair-2); }
html[data-theme="dark"] .about-actions .btn-primary { color: #141414; }
html[data-theme="dark"] #about-terms-btn { background: transparent; color: var(--ink); border-color: var(--hair-2); }
html[data-theme="dark"] .config-tab.active, html[data-theme="dark"] .config-tab.active:hover { background: var(--orange); color: var(--black); }

/* 1.4.3: Usuarios — aprovecha el ancho en escritorio: lista a la izquierda, «Mi tiempo de sesión» al lado */
#config-panel-usuarios .config-stack { max-width: 1320px; }
.users-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.users-card { background: var(--surface); border: 2px solid var(--hair); border-radius: 10px; overflow: hidden; }
.users-card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; flex-wrap: wrap; }
.users-card-head strong { font-family: var(--font-display); font-size: 1rem; color: var(--ink); }
.users-card-head p { margin: 4px 0 0; color: var(--text-2); font-size: 0.86rem; }
.users-card .data-table-wrap { border: 0; border-top: 2px solid var(--hair); border-radius: 0; margin: 0; max-width: none; }
.users-layout .session-settings { flex-direction: column; align-items: stretch; gap: 14px; }
.users-layout .session-settings .session-settings-form { flex-direction: column; align-items: stretch; }
.users-layout .session-settings .session-minutes { justify-content: space-between; }
.users-layout .session-settings .btn-primary { width: 100%; }
@media (max-width: 1100px) { .users-layout { grid-template-columns: 1fr; } }
#config-panel-usuarios .roles-compare { max-width: none; }

/* 1.4.4: Editar bloqueado (el original tiene stock prestado o en uso) */
.edit-locked, button.edit-locked { background: #3a3a3a !important; color: #bbb !important; border-color: #3a3a3a !important; cursor: not-allowed; opacity: .85; }
html[data-theme="dark"] .edit-locked, html[data-theme="dark"] button.edit-locked { background: #111 !important; color: #8a8a8a !important; border-color: #444 !important; }

/* 1.4.4: asistente de MasterKey en modo oscuro — la flecha «›» no se veía (texto claro sobre fondo blanco) */
html[data-theme="dark"] .wizard-next-btn:not(.wizard-next-create) { background: #f2f2f2; color: #141414; }
html[data-theme="dark"] .wizard-next-btn:not(.wizard-next-create):hover:not(:disabled) { background: #fff; }

/* =====================================================================
   1.4.4 · Modo escritorio: aprovechar el ancho de la pantalla
   (solo ≥ 1100 px; el teléfono y el modo Keep/POD no cambian)
   ===================================================================== */
.sidebar { flex-shrink: 0; }
.content { min-width: 0; }
/* tabla de Ubicaciones: el botón de acciones es una celda normal, no un flex suelto */
.inv-table td.row-actions { display: table-cell; white-space: nowrap; vertical-align: middle; }
.inv-table td.row-actions > * + * { margin-left: 6px; }

@media (min-width: 1100px) {
  body:not(.pod-mode) .data-table-wrap,
  body:not(.pod-mode) .config-option-list,
  body:not(.pod-mode) .config-stack,
  body:not(.pod-mode) #config-panel-usuarios .config-stack { max-width: none; }
  body:not(.pod-mode) .config-subtext { max-width: 1000px; }

  /* tabla de Ubicaciones más compacta para que quepan todas las columnas */
  body:not(.pod-mode) .inv-table th { padding: 10px 10px; font-size: 0.8rem; }
  body:not(.pod-mode) .inv-table td { padding: 8px 10px; font-size: 0.92rem; }

  /* Fecha y hora: reloj a la izquierda, formulario a la derecha */
  body:not(.pod-mode) #config-panel-fecha-hora.active { display: grid; grid-template-columns: minmax(300px, 460px) minmax(340px, 560px); gap: 8px 32px; align-items: start; }
  body:not(.pod-mode) #config-panel-fecha-hora > .config-panel-hint { grid-column: 1 / -1; }
  body:not(.pod-mode) #config-panel-fecha-hora .clock-card { max-width: none; margin: 4px 0 0; }
  body:not(.pod-mode) #config-panel-fecha-hora .config-form { max-width: none; margin-top: 4px; }

  /* Modos: Apariencia y Modo simple lado a lado */
  body:not(.pod-mode) #config-panel-modos .config-option-list { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }

  /* Notificaciones: configuración | destinatarios, y abajo las dos tablas lado a lado */
  body:not(.pod-mode) #config-panel-notificaciones .notif-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  body:not(.pod-mode) #config-panel-notificaciones .notif-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  body:not(.pod-mode) #config-panel-notificaciones .notif-section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  body:not(.pod-mode) #config-panel-notificaciones .notif-section .config-subtitle { margin-top: 0; }
  body:not(.pod-mode) #config-panel-notificaciones .notif-section .config-subtext { margin-top: 0; }
}
@media (min-width: 1400px) {
  /* las 9 pestañas de Configuración caben en una sola fila y se reparten el ancho (más angosto, envuelven) */
  body:not(.pod-mode) .config-tabs { flex-wrap: nowrap; gap: 4px; }
  body:not(.pod-mode) .config-tabs .config-tab { flex: 1 1 auto; text-align: center; padding-left: 6px; padding-right: 6px; white-space: nowrap; font-size: 0.82rem; letter-spacing: 0; }
}

/* 1.4.4: escritorios medianos (1100–1399 px): columnas más justas para que no se corten las acciones */
@media (min-width: 1100px) and (max-width: 1399px) {
  body:not(.pod-mode) .inv-table th { padding: 8px 6px; font-size: 0.74rem; }
  body:not(.pod-mode) .inv-table td { padding: 6px 6px; font-size: 0.84rem; }
  body:not(.pod-mode) .inv-table .inv-thumb { width: 36px; height: 36px; }
  body:not(.pod-mode) .users-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; }
  body:not(.pod-mode) .users-card .data-table th, body:not(.pod-mode) .users-card .data-table td { padding: 8px 7px; }
}

/* 1.4.4: Respaldos → destinos */
.bk-dests { display: flex; flex-direction: column; gap: 10px; }
.bk-dests > strong { font-family: var(--font-display); }
.bk-dests .notif-check input:disabled + span { opacity: .55; }

/* Restaurar respaldo (1.4.4) */
.restore-modal { max-width: 560px; width: 100%; max-height: 92vh; overflow-y: auto; }
.restore-warn { background: #fdecea; color: #7a1f17; border: 1px solid #f1b5ae; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 12px; }
.restore-src { border: 1px solid var(--hair, #ddd); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.restore-src legend { font-size: 13px; padding: 0 6px; }
.restore-modal select { width: 100%; }
.restore-detail { font-size: 12.5px; margin: 6px 0 12px; min-height: 1.2em; }
.restore-progress { padding: 8px 0; }
.restore-phase { font-weight: 600; margin: 0 0 10px; }
.restore-bar { height: 10px; background: rgba(0,0,0,.1); border-radius: 6px; overflow: hidden; }
.restore-bar > div { height: 100%; width: 0; background: var(--accent, #2e7d32); transition: width .5s ease; }
html[data-theme="dark"] .restore-warn { background: #3b1d1a; color: #f3c3bd; border-color: #6b2f2a; }
.restore-modal .modal-actions .btn-danger { margin-right: 0; }
.restore-modal .modal-actions { justify-content: flex-end; gap: 8px; }
.restore-modal .restore-src label.notif-check { flex-direction: row; align-items: flex-start; gap: 10px; margin: 6px 0; }
.restore-modal .restore-src label.notif-check input { width: auto; margin-top: 3px; flex: none; }
.restore-modal .restore-src label.notif-check span { display: flex; flex-direction: column; }
.restore-modal label strong { display: inline; }
.qr-viewer-note { grid-column: 1 / -1; margin-top: 6px; color: #1c5e2e; font-weight: 700; font-size: 13px; }
html[data-theme="dark"] .qr-viewer-note { color: #a9e5bc; }

/* Código de barras y Lector QR/Barras (1.4.4) */
.barcode-field { margin: 4px 0 8px; }
.lector-card { max-width: 560px; margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
#lector-scanner-wrap { margin: 6px 0 0; }
body:not(.pod-mode) #lector-scanner-wrap > div[id$="qr-reader"], #pod-lector-scanner-wrap > div[id$="qr-reader"] { width: 100%; max-width: 420px; background: #111; border-radius: 12px; overflow: hidden; }
.lector-actions { display: flex; gap: 10px; }
.lector-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
#field-barcode-wrap { margin-top: 12px; }
.barcode-field .field-hint { margin-top: 6px; }

/* 1.4.4: guía rectangular (forma de código de barras) sobre las cámaras de Lector y de código de barras.
   Es solo visual: la lectura usa todo el cuadro, así que el QR también se lee. */
#lector-qr-reader, #pod-lector-qr-reader, #bc-qr-reader { position: relative; overflow: hidden; }
#lector-qr-reader::after, #pod-lector-qr-reader::after, #bc-qr-reader::after {
  content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 36%; transform: translateY(-50%);
  border: 3px solid rgba(255,255,255,.95); border-radius: 12px; pointer-events: none; z-index: 5;
  box-shadow: 0 0 0 999px rgba(0,0,0,.5);
  background: linear-gradient(#ff3b30,#ff3b30) center / calc(100% - 28px) 2px no-repeat;
}

/* Lector QR/Barras: la guía es cuadrada (como la del QR); la del formulario de código de barras sigue ancha. */
#lector-qr-reader::after, #pod-lector-qr-reader::after {
  left: 50%; right: auto; top: 50%; height: 72%; aspect-ratio: 1 / 1; width: auto; transform: translate(-50%, -50%);
  background: linear-gradient(#ff3b30,#ff3b30) center / calc(100% - 28px) 2px no-repeat;
}

/* Reordenar ubicaciones: la tarjeta que se arrastra es una copia flotante; la original queda como hueco. */
.loc-ghost { position: fixed !important; margin: 0 !important; z-index: 3000; pointer-events: none; transition: none !important; transform: scale(1.04) !important; opacity: .96; box-shadow: 0 16px 32px rgba(0,0,0,.4); cursor: grabbing; }
.loc-ghost .loc-tile-tip, .loc-ghost .loc-tile-actions { display: none !important; }
.loc-tile.is-placeholder { opacity: .3; outline: 2px dashed rgba(0,0,0,.4); outline-offset: -2px; transition: none !important; transform: none !important; }

/* Formulario de ítem del administrador en el celular: también «Tomar foto» / «Seleccionar archivo existente» */
@media (pointer: coarse), (max-width: 760px) {
  #item-form label.image-field-label { display: none; }
  #item-form .pod-photo-actions { display: flex; }
}


/* =====================================================================
   Modo Business · identidad visual (DD-008, DD-012)
   Todo va bajo html[data-mode="business"]: el modo Keep no cambia nada.
   Navy + azul neón en las barras, fondo gris azulado frío, acción en #1A5FD6.
   ===================================================================== */
/* La etiqueta «business» y el punto neón del logo solo se ven en modo Business */
.biz-tag { display: none; }
html[data-mode="business"] .biz-tag { display: inline-block; }
html[data-mode="business"] {
  --cream: #edf1f7;
  --black: #0b1530;
  --charcoal: #0f1c3d;
  --charcoal-light: #16254a;
  --orange: #1a5fd6;
  --orange-dark: #1550b8;
  --neon: #4c9aff;
  --neon-line: #3d8bff;
  --on-accent: #ffffff;
  --ink: #0b1530;
  --muted: #52607a;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #e6ecf5;
  --note-bg: #eaf2ff;
  --hair: #e1e7f0;
  --hair-2: #c8d1e0;
  --edge: #0b1530;
  --text-2: #3b4964;
  --text-3: #5f6c85;
  --loc-orange: #1a5fd6;
  --loc-orange-soft: #4c86e0;
}
html[data-mode="business"][data-theme="dark"] {
  --cream: #0b1220;
  --ink: #e8eefa;
  --muted: #9aa8c4;
  --surface: #121b30;
  --surface-2: #0f1729;
  --surface-3: #1a2744;
  --note-bg: #16233f;
  --hair: #1f2c48;
  --hair-2: #2e3f63;
  --edge: #3a4d78;
  --text-2: #c5d0e8;
  --text-3: #9aa8c4;
  --charcoal: #0a1226;
  --charcoal-light: #121d38;
  --orange: #4c9aff;
  --orange-dark: #3d8bff;
  --on-accent: #0b1530;
  --loc-orange: #2b6fd8;
  --loc-orange-soft: #4c7fc9;
}
html[data-mode="business"][data-theme="dark"] .topbar { background: #070c18; border-bottom: 1px solid #1f2c48; }
html[data-mode="business"][data-theme="dark"] .sidebar { border-right: 1px solid #1f2c48; }
html[data-mode="business"][data-theme="dark"] .topbar-icon-btn:hover,
html[data-mode="business"][data-theme="dark"] .nav-item:hover,
html[data-mode="business"][data-theme="dark"] .suggestions-list li:hover,
html[data-mode="business"][data-theme="dark"] .suggestions-list li.highlighted { background: #1f2c48; }
html[data-mode="business"][data-theme="dark"] .btn-muted { background: #3a4560; }
html[data-mode="business"][data-theme="dark"] .btn-muted:hover { background: #4a5775; }
html[data-mode="business"][data-theme="dark"] .clock-card,
html[data-mode="business"][data-theme="dark"] .report-stat-total { background: #0b1530; }
html[data-mode="business"][data-theme="dark"] .modal-overlay { background: rgba(3, 6, 14, 0.74); }

/* Barras: navy con un leve resplandor neón */
html[data-mode="business"] .topbar { box-shadow: 0 2px 14px rgba(61, 139, 255, .35); }
html[data-mode="business"] .brand-name { font-weight: 800; text-transform: lowercase; }
html[data-mode="business"] .brand-name .brand-dot { color: var(--neon); }
html[data-mode="business"] .biz-tag {
  display: inline-block; font-family: var(--font-display); font-weight: 700;
  font-size: .62em; letter-spacing: .14em; text-transform: uppercase; vertical-align: middle;
  background: var(--neon); color: #0b1530; padding: 1px 8px; border-radius: 6px; margin-left: 6px;
}
/* Marca en la barra superior: nombre y etiqueta en una sola línea, etiqueta chiquita al lado */
html[data-mode="business"] .brand-name { white-space: nowrap; }
/* Etiqueta centrada junto al nombre, como en la hoja de logos: rectángulo de esquinas suaves, a la altura de las minúsculas */
html[data-mode="business"] .topbar .brand-name .biz-tag { font-size: .4em; line-height: 1; letter-spacing: .14em; padding: .42em .9em .42em 1em; margin-left: 2px; border-radius: .55em; vertical-align: middle; position: relative; top: -.04em; }
@media (min-width: 861px) {
  html[data-mode="business"] body:not(.pod-mode) .topbar .brand { flex: 0 0 292px; }
}
html[data-mode="business"] .login-title .biz-tag { font-size: .3em; line-height: 1; letter-spacing: .14em; padding: .45em .9em .45em 1em; margin-left: 0; border-radius: .55em; vertical-align: middle; position: relative; top: -.06em; }
html[data-mode="business"] .sidebar-footer-name { white-space: nowrap; }
html[data-mode="business"] .sidebar-footer-name .biz-tag,
html[data-mode="business"] .pod-footer .biz-tag { font-size: .5em; line-height: 1; letter-spacing: .14em; padding: .45em .9em .45em 1em; margin-left: 2px; border-radius: .55em; vertical-align: middle; position: relative; top: -.04em; }
html[data-mode="business"] .nav-item:hover { background: #1c2c57; }
html[data-mode="business"] .nav-item.active { border-color: var(--neon); background: rgba(76, 154, 255, .16); }
html[data-mode="business"] .topbar-icon-btn.active { border-color: var(--neon); }
html[data-mode="business"] .badge { background: var(--neon); color: #0b1530; }
html[data-mode="business"] .sidebar-footer-version,
html[data-mode="business"] .pod-footer .pod-footer-version { color: var(--neon); }

/* Texto sobre el azul de acción: blanco (en oscuro, navy sobre el neón) */
html[data-mode="business"] .btn-primary,
html[data-mode="business"] .config-tab.active,
html[data-mode="business"] .traslado-tab.active,
html[data-mode="business"] .usar-tab.active,
html[data-mode="business"] .usar-method.active,
html[data-mode="business"] .report-chip.active,
html[data-mode="business"] .pill-chip.active,
html[data-mode="business"] .tbl-btn-primary,
html[data-mode="business"] .data-table .row-actions .tbl-btn-primary,
html[data-mode="business"] .wizard-next-btn.wizard-next-create,
html[data-mode="business"] .data-table .role-badge.role-pod,
html[data-mode="business"] .roles-compare-col .role-badge.role-pod,
html[data-mode="business"] button.report-stat.is-selected,
html[data-mode="business"] .alert-ingreso-btn:hover,
html[data-mode="business"] .item-detail-arrow:hover,
html[data-mode="business"][data-theme="dark"] .config-tab.active,
html[data-mode="business"][data-theme="dark"] .config-tab.active:hover,
html[data-mode="business"][data-theme="dark"] .flatpickr-day.selected { color: var(--on-accent); }
html[data-mode="business"] button.report-stat.is-selected { box-shadow: 0 3px 0 var(--black); }
html[data-mode="business"] .btn-primary:hover:not(:disabled) { box-shadow: 0 4px 0 rgba(11, 21, 48, .35); }

/* Acentos que estaban en naranja sobre fondo claro u oscuro */
html[data-mode="business"] .pod-footer .pod-footer-version { color: var(--orange-dark); }
html[data-mode="business"] .sidebar .sidebar-footer-version,
html[data-mode="business"] .pod-mode .pod-footer .pod-footer-version { color: var(--neon); }
html[data-mode="business"] .about-grid h3 { color: var(--orange-dark); }
html[data-mode="business"] .about-grid section { background: #fff; border-color: var(--hair); }
html[data-mode="business"] .flatpickr-day.inRange,
html[data-mode="business"] .flatpickr-day.selected.inRange { background: #dce9ff; border-color: #dce9ff; box-shadow: -5px 0 0 #dce9ff, 5px 0 0 #dce9ff; }
html[data-mode="business"] .login-input.prefilled-glow { box-shadow: 0 0 0 3px var(--orange), 0 0 16px rgba(61, 139, 255, .55); background: #eaf2ff; }
html[data-mode="business"] .theme-choice[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(26, 95, 214, .35); }
html[data-mode="business"] .report-fields input:focus,
html[data-mode="business"] .report-fields select:focus { box-shadow: 0 0 0 3px rgba(26, 95, 214, .3); }
html[data-mode="business"] .item-detail-noimage,
html[data-mode="business"] .stock-banner-note,
html[data-mode="business"] .item-detail-row dt { color: var(--text-3); }
html[data-mode="business"] .setup-email-note { color: #7a4b00; }

/* Ajustes tras revisar capturas */
html[data-mode="business"] .btn-muted { background: #52607a; }
html[data-mode="business"] .btn-muted:hover { background: #3b4964; }
html[data-mode="business"] .clock-icon,
html[data-mode="business"] .clock-label { color: var(--neon); }
html[data-mode="business"] .login-signup-hint a,
html[data-mode="business"] .login-eye-btn.active { color: var(--neon); }
html[data-mode="business"] .login-eye-btn { color: #5f6c85; }
html[data-mode="business"] .sim-switch.on {
  background: linear-gradient(135deg, #9cc4ff 0%, var(--neon-line) 55%, #1a5fd6 100%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.25), 0 0 14px rgba(76,154,255,.6);
}
html[data-mode="business"] .pod-footer { background: #0b1530; color: #c5d0e8; border-top-color: var(--neon); }
html[data-mode="business"][data-theme="dark"] .pod-footer { background: #070c18; }


/* ---------- Activación de Business (primera vez) ---------- */
.biz-onboard { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 70% -10%, #17306b 0%, #070c18 60%); }
.biz-onboard.hidden { display: none; }
.biz-onboard-card { width: 100%; max-width: 560px; background: #0d1830; color: #e8eefc; border: 1px solid #1f2c48; border-radius: 16px;
  padding: 32px; box-shadow: 0 0 40px rgba(61,139,255,.28); font-family: var(--font-body); }
.biz-ob-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: #fff; margin-bottom: 18px; white-space: nowrap; }
.biz-ob-brand span { color: #4c9aff; }
.biz-ob-brand em { font-style: normal; font-size: .5em; letter-spacing: .12em; background: #4c9aff; color: #0b1530; padding: 1px 6px; border-radius: 6px; margin-left: 6px; position: relative; top: -.35em; }
.biz-onboard-card h2 { font-family: var(--font-display); margin: 0 0 12px; font-size: 1.5rem; color: #fff; }
.biz-onboard-card p { margin: 0 0 12px; line-height: 1.5; color: #c6d3f0; }
.biz-onboard-card p strong { color: #fff; }
.biz-ob-lead { margin-top: 16px !important; }
.biz-ob-account { display: flex; align-items: center; gap: 14px; background: #0a1226; border: 1px solid #2a3b63; border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; }
.biz-ob-account img { width: 52px; height: 52px; border-radius: 50%; background: #fff; object-fit: cover; }
.biz-ob-account strong { display: block; font-size: 1.15rem; color: #fff; }
.biz-ob-account small { color: #8fa3cf; }
.biz-ob-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.biz-ob-btn { font-family: var(--font-display); font-weight: 700; font-size: 1rem; border-radius: 10px; padding: 11px 22px; cursor: pointer; border: 2px solid #4c9aff; }
.biz-ob-back { background: transparent; color: #cfe0ff; border-color: #2a3b63; }
.biz-ob-back:hover { border-color: #4c9aff; }
.biz-ob-go { background: #4c9aff; color: #0b1530; }
.biz-ob-go:hover { filter: brightness(1.1); }
.biz-ob-bar { height: 14px; border-radius: 999px; background: #0a1226; border: 1px solid #2a3b63; overflow: hidden; margin: 22px 0 14px; }
.biz-ob-fill { height: 100%; width: 0; background: linear-gradient(90deg, #3d8bff, #27e2de); border-radius: 999px; transition: width .25s ease; }
.biz-ob-status { color: #8fa3cf !important; min-height: 1.5em; }

/* ---------- Catálogo (Business) ---------- */
html:not([data-mode="business"]) .biz-only { display: none !important; }
.catalog-stats { margin-bottom: 18px; }
.catalog-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.catalog-toolbar input[type="text"] { flex: 1 1 260px; padding: 10px 14px; border: 2px solid var(--hair-2); border-radius: 8px; font-size: .95rem; }
.catalog-toolbar select { padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 8px; font-size: .95rem; }
.catalog-table td.num, .catalog-table th.num { text-align: right; white-space: nowrap; }
.catalog-table tbody tr { cursor: pointer; }
.cat-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.cat-badge.ok { background: #dcf5e6; color: #14653a; }
.cat-badge.warn { background: #fdecc8; color: #7a4b00; }
.cat-badge.bad { background: #fbd9d6; color: #8f1d14; }
html[data-mode="business"] #biz-item-fields { display: flex; flex-direction: column; gap: 14px; }

/* Kardex (Business) */
.kardex-toolbar { flex-wrap: wrap; }
.kardex-toolbar #kardex-item { min-width: 260px; flex: 1 1 260px; }
.kardex-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #667); }
.kardex-table td.num, .kardex-table th:nth-child(n+3):nth-child(-n+7) { text-align: right; }
.kardex-table .k-in { color: #1a7f4b; font-weight: 600; }
.kardex-table .k-out { color: #b3261e; font-weight: 600; }
.kardex-table tr.k-open td, .kardex-table tfoot td { font-weight: 600; background: rgba(127,127,127,.08); }
.kardex-table td.k-detail { font-size: 12px; color: var(--muted, #667); max-width: 260px; }

/* Herramientas que solo existen en Keep: en Business se ocultan */
html[data-mode="business"] .keep-only { display: none !important; }

/* Panel de Business */
.bp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.bp-title { font-size: 20px; margin: 0; }
.bp-period { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
@media (max-width: 900px) { .bp-grid { grid-template-columns: 1fr; } }
.bp-card { border: 3px solid var(--edge); border-radius: 4px; background: var(--surface); overflow: hidden; }
.bp-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; background: var(--surface-3); border-bottom: 3px solid var(--edge); }
.bp-card header h3 { margin: 0; font-size: 15px; }
.bp-card > div { padding: 14px 18px; }
.bp-chips { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 4px !important; }
.bp-chip { border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; background: rgba(127,127,127,.14); }
.bp-chip.bad { background: rgba(179,38,30,.14); color: #b3261e; }
.bp-chip.warn { background: rgba(176,112,0,.16); color: #8a5a00; }
.bp-chip.ok { background: rgba(26,127,75,.14); color: #1a7f4b; }
.bp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(127,127,127,.2); font-size: 14px; }
.bp-row:last-child { border-bottom: 0; }
.bp-row small { color: var(--muted, #667); display: block; }
.bp-row .bp-val { font-weight: 700; white-space: nowrap; text-align: right; }
.bp-delta { font-size: 12px; font-weight: 600; margin-left: 6px; }
.bp-delta.up { color: #1a7f4b; } .bp-delta.down { color: #b3261e; } .bp-delta.flat { color: var(--muted, #667); }
.bp-bar { height: 6px; border-radius: 3px; background: rgba(127,127,127,.2); margin-top: 4px; overflow: hidden; }
.bp-bar > i { display: block; height: 100%; background: #1a56db; }
.bp-empty { color: var(--muted, #667); font-size: 14px; }
.bp-note { font-size: 12px; color: var(--muted, #667); padding-top: 8px; }

/* Botones tipo píldora (mismo diseño que el rango rápido de Reportes, sin su lógica) */
.pill-chip { font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--edge); background: var(--surface); color: inherit; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.pill-chip:hover { background: var(--surface-3); transform: translateY(-1px); }
.pill-chip.active { background: var(--orange); }
.kardex-fields { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .kardex-fields { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .kardex-fields { grid-template-columns: 1fr; } }
.kardex-filters { margin-bottom: 16px; }

/* Business: el traslado interno mueve el producto completo; sin tipo (temporal / transferencia) ni responsable */
html[data-mode="business"] #movement-mode-field,
html[data-mode="business"] #movement-responsible-field { display: none !important; }

/* Business: formulario de ítem en secciones */
html[data-mode="business"] #item-modal .modal { max-width: 780px; padding: 28px 30px; }
html[data-mode="business"] #item-form .form-sec {
  border: 1px solid var(--hair-2, rgba(128,128,128,.3)); border-radius: 14px;
  padding: 16px 18px 6px; margin: 0 0 16px; background: color-mix(in srgb, var(--surface) 96%, var(--ink) 4%);
}
html[data-mode="business"] #item-form .form-sec-head { margin-bottom: 12px; }
html[data-mode="business"] #item-form .form-sec-head h3 { margin: 0; font-size: 1.02rem; }
html[data-mode="business"] #item-form .form-sec-head p { margin: 2px 0 0; font-size: .82rem; opacity: .7; }
html[data-mode="business"] #item-form .form-sec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
html[data-mode="business"] #item-form .form-sec-grid > label { min-width: 0; }
html[data-mode="business"] #item-form .form-sec-grid input,
html[data-mode="business"] #item-form .form-sec-grid select { width: 100%; box-sizing: border-box; }
html[data-mode="business"] #item-form .form-sec-note { display: block; margin-top: 4px; font-size: .76rem; line-height: 1.3; }
html[data-mode="business"] #item-form .form-sec-other { padding-bottom: 12px; }
@media (max-width: 560px) { html[data-mode="business"] #item-form .form-sec-grid { grid-template-columns: minmax(0, 1fr); } }
html[data-mode="business"] #item-form .form-sec-grid { margin-bottom: 12px; }
html[data-mode="business"] #item-form .form-sec .tag-field { margin-bottom: 12px; }
html[data-mode="business"] #item-form .form-sec-other .field-hint { margin: 8px 0 0; }
/* Business · formulario de ítem: separación pareja entre campos (los textos no se pisan) */
html[data-mode="business"] #item-form .form-sec { display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }
html[data-mode="business"] #item-form .form-sec > *,
html[data-mode="business"] #item-form .form-sec-grid > * { margin-top: 0; margin-bottom: 0; }
html[data-mode="business"] #item-form .form-sec .form-sec-grid { margin-bottom: 0; }
html[data-mode="business"] #item-form .form-sec .tag-field { margin-bottom: 0; }
html[data-mode="business"] #item-form .form-sec .suggest-hint { margin-top: -8px; }
html[data-mode="business"] #item-form .form-sec .barcode-field { margin: 0; }
html[data-mode="business"] #item-form .form-sec label { display: flex; flex-direction: column; gap: 6px; }
html[data-mode="business"] #item-form .form-sec .check-card { flex-direction: row; }
html[data-mode="business"] #item-form .form-sec-other .field-hint { margin-top: -6px; }

/* Business · tabla de una bodega */
.inv-biz-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 4px 0 14px; }
.inv-biz-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.inv-biz-stats > div { display: flex; flex-direction: column; }
.inv-biz-stats strong { font-size: 1.3rem; line-height: 1.15; }
.inv-biz-stats span { font-size: .78rem; opacity: .7; }
.inv-biz-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-chip-n { margin-left: 4px; font-weight: 700; opacity: .75; }
.inv-prod { display: flex; align-items: center; gap: 10px; }
.inv-prod small { display: block; }
.inv-thumb-sm { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: 0 0 36px; }
.inv-thumb-empty { display: inline-block; background: var(--hair-2, rgba(128,128,128,.25)); }
.inv-table th.num, .inv-table td.num { text-align: right; white-space: nowrap; }
.inv-biz-strip { padding: 12px 18px 4px; margin: 0 0 10px; }

/* Business · ficha del producto: movimientos recientes */
.item-detail-biz { margin: 16px 0; }
.item-detail-biz.hidden { display: none; }
.idb-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.idb-head h3 { margin: 0; font-size: 1.05rem; }
.idb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.item-detail-biz .data-table th.num, .item-detail-biz .data-table td.num { text-align: right; white-space: nowrap; }

/* Business · Configuración → Motivos */
#reasons-table th.num, #reasons-table td.num { text-align: right; }
#reasons-table tr.row-inactive td { opacity: .6; }
/* Business tiene 10 pestañas de Configuración (suma «Motivos»): se permite que pasen a una segunda fila en vez de desbordar */
@media (min-width: 1400px) {
  html[data-mode="business"] body:not(.pod-mode) .config-tabs { flex-wrap: wrap; }
  html[data-mode="business"] body:not(.pod-mode) .config-tabs .config-tab { flex: 0 1 auto; padding-left: 12px; padding-right: 12px; }
}

/* Presentaciones (Business) */
.pres-box { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--hair-2); border-radius: 10px; }
.pres-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.pres-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pres-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pres-row .pres-name { flex: 1 1 140px; min-width: 0; }
.pres-row .pres-units { width: 80px; }
.pres-add { align-self: flex-start; }
#movement-pack-hint { display: block; margin-top: 4px; }

/* Selector de columnas (Business) */
.inv-cols-wrap { position: relative; display: inline-block; }
.inv-cols-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--hair-2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.inv-cols-menu.hidden { display: none; }
.inv-cols-menu label { display: flex; align-items: center; gap: 8px; font-weight: 400; }

/* Business + modo oscuro: las reglas claras de Business pisaban al tema oscuro (Acerca de, calendario, botones) */
html[data-mode="business"][data-theme="dark"] .about-grid section { background: var(--surface-2); border-color: var(--hair-2); }
html[data-mode="business"][data-theme="dark"] .about-grid h3 { color: var(--orange); }
html[data-mode="business"][data-theme="dark"] .flatpickr-day.inRange,
html[data-mode="business"][data-theme="dark"] .flatpickr-day.selected.inRange { background: #1f2c48; border-color: #1f2c48; box-shadow: -5px 0 0 #1f2c48, 5px 0 0 #1f2c48; }
html[data-mode="business"][data-theme="dark"] .login-input.prefilled-glow { background: #0b1530; }
html[data-mode="business"][data-theme="dark"] .setup-email-note { color: var(--orange); }
html[data-mode="business"][data-theme="dark"] .btn-muted { background: #3a4560; }
html[data-mode="business"][data-theme="dark"] .btn-muted:hover { background: #4a5775; }
html[data-mode="business"][data-theme="dark"] .login-eye-btn { color: #9fb0d0; }

/* Panel de Business: gráficos y bloques nuevos (más vendidos, días de inventario, compras vs. ventas, valor en el tiempo) */
.bp-wide { grid-column: 1 / -1; }
.bp-bignum { font-size: 14px; margin: 0 0 4px; } .bp-bignum b { font-size: 34px; line-height: 1.1; }
.bp-sub { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 2px; }
.bp-chart { width: 100%; height: auto; display: block; }
.bp-grid-line { stroke: var(--hair-2); stroke-width: 1; }
.bp-axis { fill: var(--muted); font-size: 11px; }
.bp-bar-buy { fill: #9aa8c4; background: #9aa8c4; }
.bp-bar-sell { fill: var(--orange); background: var(--orange); }
.bp-line { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linejoin: round; }
.bp-area { fill: var(--orange); opacity: .12; }
.bp-dot { fill: var(--orange); stroke: var(--surface); stroke-width: 2; }
.bp-hit { fill: transparent; }
.bp-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-top: 6px; }
.bp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* Elección de modo tras crear la cuenta */
.mode-picker { position: fixed; inset: 0; z-index: 290; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 28px 18px;
  background: radial-gradient(1100px 560px at 50% -12%, #2a2a33 0%, #0d0d10 62%); color: #f3f3f6; }
.mode-picker.hidden { display: none; }
.mp-shell { width: 100%; max-width: 1020px; }
.mode-picker h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 8px; text-align: center; color: #fff; }
.mp-lead { text-align: center; margin: 0 auto 22px; max-width: 640px; color: #c9c9d3; line-height: 1.5; }
.mp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .mp-grid { grid-template-columns: 1fr; } }
.mp-card { position: relative; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; cursor: pointer; background: #17171c; border: 2px solid #2d2d36;
  transition: transform .18s var(--ease-out, ease), border-color .18s, box-shadow .18s; outline: none; }
.mp-card:hover, .mp-card:focus-visible { transform: translateY(-4px); }
.mp-keep:hover, .mp-keep:focus-visible { border-color: var(--orange, #ff8a00); box-shadow: 0 10px 34px rgba(255,138,0,.28); }
.mp-biz { background: #0d1830; border-color: #1f2c48; }
.mp-biz:hover, .mp-biz:focus-visible { border-color: #4c9aff; box-shadow: 0 10px 34px rgba(61,139,255,.34); }
.mp-media { position: relative; aspect-ratio: 16 / 9; background: #000; }
.mp-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-hint { position: absolute; right: 10px; bottom: 10px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; transition: opacity .2s; }
.mp-card.is-playing .mp-hint { opacity: 0; }
.mp-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mp-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: #fff; white-space: nowrap; }
.mp-brand span { color: var(--orange, #ff8a00); }
.mp-biz .mp-brand span { color: #4c9aff; }
.mp-brand em { font-style: normal; font-size: .5em; letter-spacing: .12em; background: #4c9aff; color: #0b1530; padding: 1px 6px; border-radius: 6px; margin-left: 6px; position: relative; top: -.35em; }
.mp-for { margin: 0; color: #e4e4ea; font-weight: 600; line-height: 1.4; }
.mp-body ul { margin: 0; padding-left: 18px; color: #bdbdc8; font-size: .92rem; line-height: 1.55; }
.mp-cta { margin-top: auto; align-self: flex-start; padding: 9px 20px; border-radius: 999px; font-weight: 800; background: var(--orange, #ff8a00); color: #111; }
.mp-biz .mp-cta { background: #4c9aff; color: #0b1530; }
.mp-tag { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; background: #fff; color: #111; }
.mp-foot { text-align: center; margin: 18px 0 0; color: #9a9aa6; font-size: .85rem; }
@media (prefers-reduced-motion: reduce) { .mp-card, .mp-card:hover { transition: none; transform: none; } }

/* ---------- Conteo físico (Business, Snapshot 3) ---------- */
.cat-badge.info { background: #dbe8ff; color: #173a8a; }
.cat-badge.mute { background: #e6e8ee; color: #4a5160; }
.counts-table td.num, .counts-table th.num { text-align: right; white-space: nowrap; }
.counts-table small { display: block; color: var(--muted, #667); font-size: .78rem; font-weight: 400; }
.counts-table tr.counts-row { cursor: pointer; }
.counts-head { margin-bottom: 16px; min-height: 0; }
.counts-head-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.counts-head-top h2 { margin: 0; }
.counts-head .info-note { margin-top: 10px; }
.counts-head .form-message { margin: 10px 0 0; }
.counts-progress { margin: 0 0 12px; font-weight: 600; }
.counts-input { width: 7.5rem; padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 8px; font-size: 1.05rem; text-align: right; background: var(--surface, #fff); color: inherit; }
.counts-input:focus { outline: none; border-color: #1a56db; }
.counts-input.is-bad { border-color: #b3261e; }
.counts-unit { margin-left: 6px; color: var(--muted, #667); font-size: .85rem; }
.counts-saved { display: inline-block; min-width: 1.2em; margin-left: 6px; color: #1a7f4b; font-weight: 800; }
.counts-line.is-counted .counts-input { border-color: #7fc79f; }
.counts-diff-plus { color: #1a7f4b; font-weight: 700; }
.counts-diff-minus { color: #b3261e; font-weight: 700; }
.counts-uncounted td { opacity: .6; }
.counts-showall { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: .92rem; }
#counts-review-table.counts-hide-now .counts-now-col { display: none; }
#counts-review .stats-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { #counts-review .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.counts-table small.counts-code-inline, .counts-val-inline { display: none; }
@media (max-width: 600px) {
  .counts-table { min-width: 0; }
  .counts-table th { white-space: normal; font-size: .7rem; line-height: 1.2; }
  .counts-table th.num, .counts-table td.num { padding-left: 4px; padding-right: 4px; }
  .counts-val-col, .counts-now-col { display: none; }
  .counts-val-inline { display: inline; }
  .counts-table th, .counts-table td { padding-left: 8px; padding-right: 8px; }
  .counts-code-col { display: none; }
  .counts-table small.counts-code-inline { display: block; font-weight: 700; color: var(--text-2, inherit); }
  .counts-input { width: 5.2rem; padding: 10px 8px; }
  .counts-unit { display: none; }
  .counts-saved { margin-left: 4px; min-width: 1em; }
  #counts-review .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Conteos: botón Editar de la revisión (administrador) */
.counts-edit-col { text-align: right; white-space: nowrap; width: 1%; }
#counts-review-table.counts-no-edit .counts-edit-col { display: none; }
.counts-edit-btn { padding: 4px 12px; font-size: 0.85rem; }
.counts-edit-inline { display: none; }
@media (max-width: 860px) {
  .counts-edit-col { display: none; }
  .counts-edit-inline { display: inline-block; margin-top: 4px; padding: 3px 10px; font-size: 0.78rem; }
}

/* Panel de Business: filas de producto que abren su ficha */
.bp-row-link { cursor: pointer; border-radius: 8px; transition: background 0.12s; }
.bp-row-link:hover, .bp-row-link:focus-visible { background: rgba(26, 95, 214, 0.08); outline: none; }
.bp-row-link:focus-visible { box-shadow: 0 0 0 2px #1A5FD6 inset; }

/* Ficha del ítem: código de barras */
.item-detail-barcodepic { display: flex; align-items: center; justify-content: center; background: #fff; padding: 16px; box-sizing: border-box; }
.item-detail-barcodepic svg { max-width: 100%; max-height: 100%; width: 100%; height: auto; }
.item-detail-bctools { margin: 10px 0 4px; display: grid; gap: 8px; }
.item-detail-bclabel { display: grid; gap: 4px; font-weight: 600; font-size: 0.9rem; }
.item-detail-bclabel select { width: 100%; }
.item-detail-bcbtns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Proveedores (Business) */
.sup-table td small { display: block; color: var(--muted, #667); font-size: .78rem; font-weight: 400; }
.sup-table td.num, .sup-table th.num { text-align: right; white-space: nowrap; }
.sup-table tr.counts-row { cursor: pointer; }
.sup-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 0; }
.sup-head h2 { margin: 0 0 4px; }
.sup-data { margin: 0; }
.sup-data-card { min-height: 0; }
.ids-list { display: grid; gap: 8px; }
.ids-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--hair, #e3e7ef); }
.ids-row small { display: block; color: var(--muted, #667); font-size: .78rem; }
.ids-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .sup-col-rut, .sup-col-terms, .sup-col-code, .sup-col-contact { display: none; }
  .sup-table { min-width: 0; }
}

/* Órdenes de compra (Business) */
.po-editor h3 { margin: 14px 0 6px; }
.po-addline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.po-addline input { flex: 1 1 220px; min-width: 0; }
.po-total { text-align: right; margin: 10px 4px 0; font-size: 1.05rem; }
.po-qty, .po-cost { width: 96px; text-align: right; }
.po-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.po-history li { padding: 8px 0; border-bottom: 1px solid var(--hair, #e3e7ef); }
.po-history small { display: block; color: var(--muted, #667); }
.po-h-when { color: var(--muted, #667); font-size: .85rem; margin-right: 6px; }
@media (max-width: 860px) { .po-col-bodega, .po-col-date, .po-col-lines { display: none; } .po-qty, .po-cost { width: 70px; } }

@media (max-width: 700px) { .psl-col-place { display: none; } }
@media (max-width: 700px) {
  #view-pod-stocklist .psl-col-thumb, #view-pod-stocklist .psl-col-state { display: none; }
  #view-pod-stocklist .qr-cell { width: 56px; padding-left: 4px; padding-right: 4px; }
  #view-pod-stocklist td, #view-pod-stocklist th { word-break: normal; overflow-wrap: anywhere; }
  #view-pod-stocklist td:nth-child(3) { font-size: .8rem; }
  #view-pod-stocklist td:nth-child(4) { overflow-wrap: break-word; word-break: normal; min-width: 80px; }
  #view-pod-stocklist .qr-thumb-btn img, #view-pod-stocklist .qr-thumb { width: 36px; height: 36px; }
}
@media (max-width: 700px) { #view-pod-stocklist .row-chevron, #view-pod-stocklist thead th:last-child { display: none; } #view-pod-stocklist td, #view-pod-stocklist th { padding-left: 6px; padding-right: 6px; } }

/* Recepción de mercadería (Business) */
.rc-tabs { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.rc-tabs button { padding: 8px 16px; border: 2px solid var(--edge, #0b1330); background: transparent; border-radius: 10px; font-weight: 700; cursor: pointer; color: inherit; font: inherit; font-weight: 700; }
.rc-tabs button.active { background: var(--edge, #0b1330); color: #fff; }
.rc-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.rc-doc-img { max-width: 320px; max-height: 240px; border: 2px solid var(--hair, #ccd); border-radius: 8px; margin-bottom: 8px; }
.po-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.rc-hist-row td { background: rgba(0,0,0,.03); }
@media (max-width: 860px) { .rc-col-po, .rc-col-date, .rc-col-units { display: none; } }
.po-editor label { display: block; font-weight: 600; margin: 8px 0; }
.po-editor label select, .po-editor label input:not([type=checkbox]), .po-editor label textarea { display: block; width: 100%; max-width: 100%; box-sizing: border-box; margin-top: 4px; font-weight: 400; }
.po-editor .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.po-editor .po-qty, .po-editor .po-cost { display: inline-block; width: 96px; margin: 0; }
@media (max-width: 860px) { .po-editor .po-qty, .po-editor .po-cost { width: 72px; } }

/* Snapshot 5 · Lugares dentro de una bodega */
.pl-modal { max-width: 560px; }
.pl-tree { max-height: 50vh; overflow: auto; margin: 8px 0; }
.pl-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--hair-2); }
.pl-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.pl-name input { width: 60%; }
.pl-count { font-size: .8rem; opacity: .7; white-space: nowrap; }
.pl-actions { display: flex; gap: 4px; }
.pl-actions button { padding: 2px 8px; }
.pl-add { display: flex; gap: 8px; margin: 8px 0; }
.pl-add input { flex: 1; min-width: 0; }
@media (max-width: 600px) { .pl-count { display: none; } }

/* Snapshot 5 · Traslados entre bodegas */
.st-actions { white-space: nowrap; }
.st-actions button { margin: 2px 2px 2px 0; padding: 4px 10px; }
.st-reason { width: 12em; max-width: 100%; }
@media (max-width: 700px) { .st-actions { white-space: normal; } }
.pl-modal form.pl-add { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.pl-modal form.pl-add button { width: auto; flex: 0 0 auto; white-space: nowrap; }
.pl-modal .form-error:not(.hidden) { color: #b3261e; font-weight: 600; margin: 6px 0 0; }

/* Snapshot 5 · Importar desde Excel */
.imp-modal { max-width: 880px; width: 96vw; }
.imp-drop { display: block; font-weight: 600; margin: 10px 0; }
.imp-summary { margin: 8px 0; }
.imp-ok { color: #1b7f3a; font-weight: 600; }
.imp-bad { color: #b3261e; font-weight: 600; }
.imp-table-wrap { max-height: 45vh; overflow: auto; margin: 8px 0; }
.imp-row-bad { background: rgba(179, 38, 30, .08); }
.imp-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.imp-actions button[disabled] { opacity: .5; cursor: not-allowed; }
.imp-modal .form-error:not(.hidden) { color: #b3261e; font-weight: 600; }

/* Catálogo en pantallas angostas: las tarjetas de totales no deben ensanchar la página */
.stats-grid > * { min-width: 0; }
.catalog-stats .stat-number { overflow-wrap: anywhere; font-size: clamp(1.1rem, 5.5vw, 1.8rem); }
.imp-skip { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-weight: 400; cursor: pointer; }
.imp-skip input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; }
@media (max-width: 700px) {
  #st-wrap table, #st-wrap tbody, #st-wrap tr, #st-wrap td { display: block; width: 100%; }
  #st-wrap thead { display: none; }
  #st-wrap tr { border: 1px solid var(--hair-2); border-radius: 10px; margin: 0 0 10px; padding: 6px 10px; background: var(--card-bg, transparent); }
  #st-wrap td { padding: 3px 0; border: 0; }
  #st-wrap td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; opacity: .7; }
}

/* Formularios de Business (órdenes, recepciones, traslados): mismos campos que los formularios de ítems y movimientos */
.po-editor { min-height: 0; }
.po-editor h2, .po-editor h3 { font-family: var(--font-display); }
.po-editor form, form.po-editor { display: flex; flex-direction: column; gap: 14px; }
.po-editor label { font-size: .9rem; font-weight: 700; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.po-editor label input[type="checkbox"] { width: 18px; height: 18px; }
.po-editor input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.po-editor select, .po-editor textarea {
  font-family: var(--font-body); font-weight: 400; font-size: .95rem;
  padding: 11px 14px; border: 2px solid var(--hair-2); border-radius: 8px;
  background: var(--surface); color: var(--ink); width: 100%; box-sizing: border-box; margin: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.po-editor input::placeholder, .po-editor textarea::placeholder { color: var(--muted, #7a8196); opacity: .8; }
.po-editor input:focus-visible, .po-editor select:focus-visible, .po-editor textarea:focus-visible {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 25%, transparent);
}
.po-editor select { appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.po-editor .field-hint { margin: -6px 0 0; font-size: .82rem; }
.po-editor button[type="submit"] { align-self: flex-start; padding: 12px 22px; }
.po-editor .po-qty, .po-editor .po-cost { display: inline-block; width: 96px; padding: 8px 10px; }
.imp-modal .imp-drop input[type="file"] { display: block; margin-top: 6px; width: 100%; padding: 12px; border: 2px dashed var(--hair-2); border-radius: 8px; background: var(--surface); box-sizing: border-box; }
.pl-modal .pl-add input, .st-reason {
  font-family: var(--font-body); padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: .95rem; box-sizing: border-box;
}
.po-editor > h2:first-child, .po-editor > h3:first-child { margin-top: 0; }
.po-editor input::-webkit-calendar-picker-indicator { opacity: .45; }

/* Selector de lugar en árbol (formulario del ítem, Business) */
#place-picker-modal { z-index: 1200; }
.plp-row { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--hair-2); border-radius: 8px; margin-bottom: 6px; background: var(--surface, transparent); }
.plp-row:hover, .plp-row.plp-current { border-color: var(--orange); }
.plp-row .pl-name { flex: 1; min-width: 0; font-weight: 600; }
.plp-toggle { background: none; border: 0; color: inherit; font-size: 1.1rem; width: 28px; height: 28px; cursor: pointer; padding: 0; }
.plp-leaf { display: inline-block; text-align: center; opacity: .4; line-height: 28px; }
.dock-edit-mode #item-form label:has(input:disabled), .dock-edit-mode #item-form label:has(select:disabled) { opacity: .55; }
.dock-edit-mode #item-form button:disabled { opacity: .4; cursor: not-allowed; }
#inv-place-filter { padding: 10px 12px; border: 2px solid var(--hair-2); border-radius: 8px; font-size: .95rem; background: var(--surface); color: var(--ink); max-width: 100%; }
#catalog-place { background: var(--surface); color: var(--ink); }

/* Reportes de Business (Snapshot 6) */
.rep-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.rb-sub { margin: 22px 0 10px; font-family: var(--font-display); }
#rep-biz .report-fields { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
@media (max-width: 700px) {
  .rb-table thead { display: none; }
  .rb-table tr { display: block; border: 1px solid var(--hair-2); border-radius: 10px; margin: 0 0 10px; padding: 6px 10px; background: var(--surface); }
  .rb-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  .rb-table td::before { content: attr(data-label); font-weight: 700; text-align: left; color: var(--muted); }
}

/* Pantalla de elección de modo: volver y recordar */
.mp-close { background: none; border: 0; color: #c9c9d3; font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; margin-bottom: 8px; }
.mp-close:hover { color: #fff; }
.mp-remember { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 20px auto 0; color: #e4e4ea; font-weight: 600; cursor: pointer; text-align: center; }
.mp-remember input { width: 18px; height: 18px; accent-color: var(--orange, #ff8a00); }
.mp-remember.hidden { display: none; }
.mp-keep .mp-brand span { color: #ff8a00; }
.mp-keep .mp-cta { background: #ff8a00; color: #111; }
.mp-keep:hover, .mp-keep:focus-visible { border-color: #ff8a00; box-shadow: 0 10px 34px rgba(255,138,0,.28); }
.mp-remember input { accent-color: #4c9aff; }

/* ---------- Snapshot 6.4 · Tablas desplazables a los lados en móvil + barra fija en Dock/POD ---------- */
/* Barra superior (logo, campanita, usuario) siempre visible en Dock y POD, también al hacer scroll */
body.pod-mode .topbar { position: sticky; top: 0; z-index: 60; }

/* Todas las tablas se pueden arrastrar con el dedo hacia los lados, sin que se aplasten las columnas */
.table-wrap, .data-table-wrap, .pod-stock-wrap,
body.pod-mode .data-table-wrap, body.pod-mode .pod-stock-wrap {
  overflow-x: auto; overflow-y: hidden; max-width: 100%;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  /* sombritas a los bordes que avisan que hay más contenido al deslizar */
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left center / 24px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right center / 24px 100% no-repeat local,
    linear-gradient(to right, rgba(0,0,0,.22), transparent) left center / 10px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0,0,0,.22), transparent) right center / 10px 100% no-repeat scroll,
    var(--surface);
}
.data-table-wrap { overflow-x: auto; }

@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  /* Columnas con su ancho natural: el texto de cabecera y los códigos no se parten letra por letra */
  .data-table, body.pod-mode .data-table { table-layout: auto; width: 100%; min-width: 600px; }
  .inv-table, body.pod-mode .inv-table { table-layout: auto; min-width: 640px; }
  .data-table th, .inv-table th,
  body.pod-mode .data-table th { white-space: nowrap; word-break: normal; overflow-wrap: normal; }
  .data-table td, .inv-table td,
  body.pod-mode .data-table td {
    white-space: nowrap; word-break: normal; overflow-wrap: normal; vertical-align: middle;
    padding: 10px 12px; font-size: 0.88rem;
  }
  /* Columnas de texto largo: pueden bajar de línea, pero con un ancho mínimo cómodo */
  .data-table td.wrap-ok, .qrhist-table td:nth-child(6), .qrhist-table td:nth-child(4), .qrhist-table td:nth-child(5),
  .data-table td.muted:last-child { white-space: normal; min-width: 130px; }
  .qrhist-table td:nth-child(6) { min-width: 190px; }
  /* Números alineados a la derecha en la ficha y reportes */
  .data-table th.num, .data-table td.num, .inv-table th.num, .inv-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .qrhist-table { min-width: 760px; }
  .qrhist-table th:nth-child(7), .qrhist-table td:nth-child(7) { display: table-cell; }

  /* Dock/POD: la lista de existencias ya está pensada para caber; «Usar» y «Devolver» se ordenan y, si hace falta, se deslizan */
  body.pod-mode .pod-stock-table { table-layout: fixed; min-width: 0; }
  body.pod-mode .pod-stock-table td { white-space: normal; word-break: break-word; }
  body.pod-mode #usar-panel-usar .data-table, body.pod-mode #usar-panel-devolver .data-table { table-layout: auto; min-width: 460px; }
  body.pod-mode #usar-panel-usar .data-table td:nth-child(2), body.pod-mode #usar-panel-devolver .data-table td:nth-child(2) { white-space: normal; min-width: 110px; }
  body.pod-mode #usar-panel-usar .data-table th:first-child, body.pod-mode #usar-panel-usar .data-table td:first-child,
  body.pod-mode #usar-panel-usar .data-table th:nth-child(4), body.pod-mode #usar-panel-usar .data-table td:nth-child(4) { width: auto; }
  body.pod-mode #usar-panel-devolver .data-table td:last-child { width: auto; white-space: nowrap; }
  body.pod-mode #usar-panel-devolver .tbl-btn { font-size: 0.78rem; padding: 6px 10px; white-space: nowrap; }
}

/* Etiquetas de acceso por modo (Usuarios): Keep naranja, Business azul */
.mode-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mode-tag-keep { background: #f2a93b; color: #141414; }
.mode-tag-business { background: #1d6fd6; color: #fff; }
#grant-access-card { margin-top: 18px; }
#grant-access-card.grant-flash { border-color: #1d6fd6; box-shadow: 0 0 0 3px rgba(29,111,214,.25); }
#grant-access-card td.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#grant-tbody .row-actions button { background: var(--surface); border: 2px solid var(--edge); border-radius: 8px; padding: 7px 14px; font-size: .85rem; font-weight: 700; line-height: 1.2; color: var(--ink); }
#grant-tbody .row-actions button:hover { background: var(--hair); }
