/* ===========================================================
   Suministros — hoja de estilos
   Tema cálido "papel + tinta" con acento verde azulado (teal)
   =========================================================== */
:root {
  --paper: #f6f3ec;
  --paper-2: #fbf9f4;
  --card: #ffffff;
  --ink: #16201d;
  --ink-soft: #4b5a55;
  --line: #e3ddd0;
  --line-soft: #eee9df;
  --teal: #0f766e;
  --teal-700: #10302b;
  --teal-300: #5eead4;
  --teal-50: #e6f5f2;
  --amber: #b45309;
  --amber-50: #fbf0e2;
  --blue: #1d4ed8;
  --blue-50: #e7edfb;
  --green: #15803d;
  --green-50: #e6f4ea;
  --danger: #b42318;
  --danger-50: #fbeae8;
  --shadow: 0 1px 2px rgba(22, 32, 29, .05), 0 8px 24px -12px rgba(22, 32, 29, .22);
  --shadow-lg: 0 24px 60px -24px rgba(22, 32, 29, .45);
  --radius: 16px;
  --radius-sm: 10px;
  --ff-display: "Bricolage Grotesque", serif;
  --ff-body: "Hanken Grotesk", sans-serif;
  --ff-mono: "Space Mono", monospace;
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0
}

body {
  font-family: var(--ff-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 110% -10%, #eef6f3 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #f3efe3 0%, transparent 50%),
    var(--paper);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

.boot {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  color: var(--ink-soft);
  font-family: var(--ff-display);
  font-size: 18px
}

h1,
h2,
h3 {
  font-family: var(--ff-display);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -.01em
}

button {
  font-family: inherit;
  cursor: pointer
}

input,
select {
  font-family: inherit
}

a {
  color: var(--teal)
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: transform .12s ease, box-shadow .2s ease, background .15s ease, border-color .15s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow)
}

.btn:active {
  transform: translateY(0)
}

.btn-primary {
  background: var(--teal-700);
  color: #eafff8;
  border-color: var(--teal-700)
}

.btn-primary:hover {
  background: #0c2723
}

.btn-accent {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal)
}

.btn-accent:hover {
  background: #0c5e57
}

.btn-danger {
  background: var(--danger-50);
  color: var(--danger);
  border-color: #f0c5bf
}

.btn-ghost {
  background: transparent;
  border-color: transparent
}

.btn-ghost:hover {
  background: #00000008;
  box-shadow: none
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px
}

.btn-icon {
  padding: 8px;
  border-radius: 10px;
  width: 34px;
  height: 34px
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none
}

/* ---------- Campos ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .02em;
  text-transform: uppercase
}

.input,
select.input,
textarea.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}

textarea.input {
  resize: vertical;
  min-height: 72px
}

.input:focus,
select.input:focus,
textarea.input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-50)
}

.pw-wrap {
  position: relative
}

.pw-wrap .input {
  padding-right: 40px
}

.pw-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 4px;
  display: flex;
  align-items: center;
  line-height: 1
}

.pw-eye:hover {
  color: var(--teal)
}

.pw-eye svg {
  width: 18px;
  height: 18px
}

/* ---------- Pantallas de entrada (login/setup) ---------- */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px
}

.gate-card .brand {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center
}

.brand .logo {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35)
}

.brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.brand h1 {
  font-size: 23px;
  font-weight: 800
}

.brand .sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 6px
}

.gate-card .brand .logo {
  width: 120px;
  height: 120px;
  border-radius: 18px
}

.gate-card .brand h1 {
  font-size: 26px
}

.gate-card h2 {
  font-size: 19px;
  margin-bottom: 4px
}

.gate-card .hint {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 20px
}

.err {
  background: var(--danger-50);
  color: var(--danger);
  border: 1px solid #f0c5bf;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 14px
}

.btn-link {
  background: none;
  border: none;
  color: var(--teal);
  font-size: 13.5px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px
}

.btn-link:hover {
  color: var(--teal-d)
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none
}

.remember-label input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0
}

/* ---------- Estructura de la app ---------- */
.shell {
  display: flex;
  min-height: 100dvh
}

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--teal-700);
  color: #cfe9e2;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.sidebar .brand h1 {
  color: #eafff8;
  font-size: 20px
}

.sidebar .brand .sub {
  color: #7fc3b6
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 18px
}

.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #bfe0d8;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14.5px;
  transition: background .15s, color .15s;
}

.nav button svg {
  width: 19px;
  height: 19px;
  opacity: .85
}

.nav button:hover {
  background: #ffffff14;
  color: #fff
}

.nav button.active {
  background: #eafff8;
  color: var(--teal-700)
}

.nav button.active svg {
  opacity: 1
}

.side-foot {
  margin-top: auto;
  border-top: 1px solid #ffffff1f;
  padding-top: 14px
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px
}

.who .av {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #16423b;
  display: grid;
  place-items: center;
  font-family: var(--ff-display);
  font-weight: 800;
  color: #9fe6d8
}

.who .meta {
  line-height: 1.2;
  min-width: 0
}

.who .meta b {
  color: #eafff8;
  font-size: 14px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.who .meta span {
  font-size: 11.5px;
  color: #7fc3b6
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column
}

.topbar {
  display: none
}

.content {
  padding: 30px clamp(10px, 2.5vw, 28px);
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
  flex: 1
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px
}

.page-head h2 {
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em
}

.page-head .desc {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 4px
}

/* Etiqueta de rol */
.role-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap
}

.role-admin {
  background: #d0faf4;
  color: #0a5e55;
  border-color: #9fe6d8
}

.role-almacen {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #bfdbfe
}

.role-editor {
  background: #e7edfb;
  color: #1d4ed8;
  border-color: #c7d7f9
}

.role-vista {
  background: var(--line-soft);
  color: var(--ink-soft);
  border-color: var(--line)
}

.role-vendedor {
  background: #fef3c7;
  color: #92400e;
  border-color: #f5d9ab
}

.role-cajas {
  background: #fce7f3;
  color: #9d174d;
  border-color: #f9a8d4
}

/* ---------- Calendario ---------- */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px
}

.cal-toolbar .week-label {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 16px;
  min-width: 210px
}

.cal-toolbar .spacer {
  flex: 1
}

.search {
  position: relative
}

.search input {
  padding-left: 34px;
  width: 200px
}

.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--ink-soft)
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px
}

.day-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 160px
}

.day-col.today {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-50)
}

.day-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper-2)
}

.day-add-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 2px 5px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
  opacity: .5;
  transition: opacity .15s, background .15s
}

.day-add-btn:hover {
  opacity: 1;
  background: var(--teal-50);
  color: var(--teal)
}

.day-head .dow {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft)
}

.day-head .dnum {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 18px
}

.day-col.today .day-head .dnum {
  color: var(--teal)
}

.day-head .count {
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--line-soft);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600
}

.day-cerrado-pill {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  flex-shrink: 0;
  border: none
}

.day-cerrado-toggle {
  cursor: pointer;
  transition: opacity .15s
}

.day-cerrado-toggle:hover {
  opacity: .75
}

.day-cerrado-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  padding: 1px 3px;
  border-radius: 6px;
  opacity: .3;
  transition: opacity .15s
}

.day-cerrado-btn:hover {
  opacity: 1
}

.mob-tab--cerrado .mob-tab-dnum {
  color: #dc2626
}

.day-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1
}

.day-empty {
  color: #bcb6a7;
  font-size: 12.5px;
  text-align: center;
  padding: 14px 4px;
  font-style: italic
}

/* Botón añadir en día vacío — ocupa todo el hueco, borde punteado */
.day-body-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  flex: 1;
  min-height: 80px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color .15s, color .15s, background .15s;
}

.day-body-add svg {
  width: 22px;
  height: 22px;
  opacity: .45;
  transition: opacity .15s
}

.day-body-add span {
  opacity: .7
}

.day-body-add:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-50)
}

.day-body-add:hover svg {
  opacity: 1
}

.day-body-add:hover span {
  opacity: 1
}

/* Variante compacta — debajo de los documentos existentes */
.day-body-add--compact {
  flex-direction: row;
  min-height: 30px;
  flex: 0;
  font-size: 11.5px;
  font-weight: 600;
  gap: 4px;
  border-style: dashed;
  border-width: 1.5px;
  border-radius: 8px;
  padding: 4px 8px;
}

.day-body-add--compact svg {
  width: 13px;
  height: 13px
}

/* --- Grupos plegables por número de documento --- */
.doc-group {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-left-color: var(--line);
  border-radius: 10px;
  overflow: hidden
}

.doc-group:has(.doc-more-wrap.open) {
  overflow: visible
}

.doc-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  cursor: pointer;
  user-select: none;
  background: var(--line-soft);
  transition: background .15s;
  border-radius: 9px 9px 0 0
}

.doc-group:not([open]) summary {
  border-radius: 9px
}

.doc-group summary::-webkit-details-marker {
  display: none
}

.doc-group summary:hover {
  background: var(--line)
}

/* Colores de estado en el header del grupo */
.doc-group.grp-none {
  border-left-color: #9c9890
}

.doc-group.grp-none summary {
  background: #e5e3df
}

.doc-group.grp-none summary:hover {
  background: #d5d2cc
}

.doc-group.grp-preparado {
  border-left-color: var(--blue)
}

.doc-group.grp-preparado summary {
  background: #dde8fb
}

.doc-group.grp-preparado summary:hover {
  background: #cdd8f5
}

.doc-group.grp-reparto {
  border-left-color: var(--amber)
}

.doc-group.grp-reparto summary {
  background: #fef0d8
}

.doc-group.grp-reparto summary:hover {
  background: #f8e5c6
}

.doc-group.grp-entregado {
  border-left-color: var(--green)
}

.doc-group.grp-entregado summary {
  background: #d8eede
}

.doc-group.grp-entregado summary:hover {
  background: #c8e4d2
}

.doc-group.grp-finalizado {
  border-left-color: #7c3aed
}

.doc-group.grp-finalizado summary {
  background: #ede9fe
}

.doc-group.grp-finalizado summary:hover {
  background: #ddd6fe
}

.doc-group.grp-partial-finalizado {
  border-left-color: #7c3aed
}

.doc-group.grp-partial-finalizado summary {
  background: linear-gradient(to right, #ede9fe 0%, var(--card) 75%)
}

.doc-group.grp-partial-finalizado summary:hover {
  background: linear-gradient(to right, #ddd6fe 0%, var(--line-soft) 75%)
}

/* Parcial: gradiente izquierda → derecha (algunos artículos han avanzado, no todos) */
.doc-group.grp-partial-preparado {
  border-left-color: var(--blue)
}

.doc-group.grp-partial-preparado summary {
  background: linear-gradient(to right, #dde8fb 0%, var(--card) 75%)
}

.doc-group.grp-partial-preparado summary:hover {
  background: linear-gradient(to right, #cdd8f5 0%, var(--line-soft) 75%)
}

.doc-group.grp-partial-reparto {
  border-left-color: var(--amber)
}

.doc-group.grp-partial-reparto summary {
  background: linear-gradient(to right, #fef0d8 0%, var(--card) 75%)
}

.doc-group.grp-partial-reparto summary:hover {
  background: linear-gradient(to right, #f8e5c6 0%, var(--line-soft) 75%)
}

.doc-group.grp-partial-entregado {
  border-left-color: var(--green)
}

.doc-group.grp-partial-entregado summary {
  background: linear-gradient(to right, #d8eede 0%, var(--card) 75%)
}

.doc-group.grp-partial-entregado summary:hover {
  background: linear-gradient(to right, #c8e4d2 0%, var(--line-soft) 75%)
}

.doc-group.grp-none.grp-pedido15 {
  border-left-color: #e74c3c
}

.doc-group.grp-none.grp-pedido15 summary {
  background: #fde8e8
}

.doc-group.grp-none.grp-pedido15 summary:hover {
  background: #fad4d4
}

.doc-group-toggle {
  display: flex;
  align-items: center;
  color: var(--ink-soft);
  transition: transform .2s;
  flex-shrink: 0
}

.doc-group[open] .doc-group-toggle {
  transform: rotate(90deg)
}

.doc-group-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px
}

.doc-group-title {
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.doc-group-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap
}

.doc-group-count {
  font-size: 11px;
  color: var(--ink-soft);
  background: rgba(0, 0, 0, .08);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  flex-shrink: 0;
  align-self: flex-start
}

.copy-doc {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: color .15s, background .15s, transform .15s
}

.copy-doc svg {
  width: 14px;
  height: 14px
}

.copy-doc:hover {
  background: rgba(0, 0, 0, .08);
  color: var(--teal);
  transform: scale(1.25)
}

.add-to-doc {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--ink-soft);
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  transition: color .15s, background .15s, transform .15s
}

.add-to-doc:hover {
  background: var(--teal-50);
  color: var(--teal);
  transform: scale(1.25)
}

@media (min-width:881px) {
  .add-to-doc {
    display: flex
  }
}

.doc-more-wrap {
  position: relative;
  flex-shrink: 0
}

.doc-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
  transition: color .15s, background .15s
}

.doc-more-btn:hover {
  background: rgba(0, 0, 0, .08);
  color: var(--ink)
}

.doc-more-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  z-index: 200;
  min-width: 160px;
  padding: 4px;
  flex-direction: column;
  gap: 2px
}

.doc-more-wrap.open .doc-more-menu {
  display: flex
}

.doc-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  transition: background .15s, color .15s
}

.doc-more-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0
}

.doc-more-item:hover {
  background: var(--hover)
}

.redate-doc.doc-more-item:hover {
  color: var(--blue)
}

.del-doc.doc-more-item:hover {
  color: var(--danger);
  background: rgba(220, 38, 38, .08)
}

.del-doc--undo {
  color: var(--danger) !important
}

.del-doc--undo:hover {
  color: var(--teal) !important
}

.grp-pending-del {
  opacity: .55;
  border-style: dashed !important
}

.doc-title-pending {
  text-decoration: line-through;
  opacity: .7
}

.doc-group-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px
}

.doc-body-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 12px;
  border: none;
  border-radius: 9px;
  background: var(--teal-50);
  cursor: pointer;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  transition: background .15s, box-shadow .15s, transform .1s;
}

.doc-body-add-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0
}

.doc-body-add-btn:hover {
  background: #c8ede8;
  box-shadow: 0 2px 8px rgba(15, 118, 110, .18);
  transform: translateY(-1px)
}

.doc-body-add-btn:active {
  transform: translateY(0);
  box-shadow: none
}

.entry {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 9px 10px;
  background: var(--paper-2);
  position: relative;
  transition: box-shadow .15s, transform .1s;
  cursor: pointer
}

.entry:hover {
  box-shadow: var(--shadow)
}

.entry .doc {
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all
}

.entry .prod {
  font-size: 13px;
  font-weight: 600;
  margin: 3px 0 1px
}

.entry .pob {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 4px
}

.entry .pob svg {
  width: 11px;
  height: 11px
}

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-top: 6px;
  letter-spacing: .02em
}

.b-sumi {
  background: var(--blue-50);
  color: var(--blue)
}

.b-instalacion {
  background: var(--amber-50);
  color: var(--amber)
}

.b-ambos {
  background: var(--green-50);
  color: var(--green)
}

.b-none {
  background: var(--line-soft);
  color: var(--ink-soft)
}

.b-custom {
  background: #f3e8ff;
  color: #7c3aed
}

.b-custom-type {
  background: #fdf4ff;
  color: #a21caf;
  border: 1px solid #e9d5ff
}

.b-nopagado {
  background: #fee2e2;
  color: #dc2626;
  font-weight: 800
}

/* --- Colores de estado del envío --- */
.entry[class*="status-"] {
  padding-left: 12px
}

.entry.status-none {
  background: #e5e3df;
  border-color: #c2bdb5;
  border-left: 4px solid #9c9890
}

.entry.status-preparado {
  background: #dde8fb;
  border-color: #93b4f0;
  border-left: 4px solid var(--blue)
}

.entry.status-reparto {
  background: #fef0d8;
  border-color: #e8b96a;
  border-left: 4px solid var(--amber)
}

.entry.status-entregado {
  background: #d8eede;
  border-color: #7cc899;
  border-left: 4px solid var(--green)
}

.entry.status-finalizado {
  background: #ede9fe;
  border-color: #a78bfa;
  border-left: 4px solid #7c3aed
}

/* --- Tarjeta compacta de artículo dentro del grupo --- */
.art-mini {
  border-radius: 8px !important;
  padding: 7px 10px !important
}

.art-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px
}

.art-mini-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0
}

.art-mini-refs {
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink)
}

.art-mini-product {
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px
}

.art-mini-status-lbl {
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0
}

.asl-status-none {
  color: #9c9890
}

.asl-status-preparado {
  color: var(--blue)
}

.asl-status-reparto {
  color: var(--amber)
}

.asl-status-entregado {
  color: var(--green)
}

.asl-status-finalizado {
  color: #7c3aed
}

.art-mini-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, .08)
}

/* --- Checklist en la tarjeta --- */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, .08)
}

.chk-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none
}

.chk-label input[type=checkbox] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--teal);
  flex-shrink: 0
}

.chk-label input:disabled {
  cursor: not-allowed;
  opacity: .55
}

/* Pedido al 15 — solo pinta rojo si no hay otro estado activo */
.chk-p15 {
  color: #c0392b;
  font-weight: 700
}

.chk-p15 input[type=checkbox] {
  accent-color: #e74c3c
}

.entry.status-none.pedido15-on {
  background: #fde8e8;
  border-color: #f5b7b1;
  border-left: 4px solid #e74c3c
}

/* --- Info y notas en la tarjeta --- */
/* Etiqueta de estado para modo vista (sin checkboxes) */
.status-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 7px;
  letter-spacing: .02em
}

.st-preparado {
  background: var(--blue-50);
  color: var(--blue)
}

.st-reparto {
  background: var(--amber-50);
  color: var(--amber)
}

.st-entregado {
  background: var(--green-50);
  color: var(--green)
}

.st-finalizado {
  background: #ede9fe;
  color: #5b21b6
}

.st-pedido15 {
  background: #fde8e8;
  color: #c0392b
}

/* Punto rojo de documento duplicado */
.dup-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  animation: pulse-red 1.6s ease-in-out infinite
}

@keyframes pulse-red {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(180, 35, 24, .5)
  }

  60% {
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0)
  }
}

.art-ref {
  font-size: 11.5px;
  margin: 2px 0
}

.art-link {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px dashed var(--teal-300)
}

.art-link:hover {
  border-bottom-style: solid
}

.grp-art-link {
  font-size: 10.5px;
  white-space: nowrap;
  flex-shrink: 0
}

.maps-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px dashed rgba(29, 78, 216, .35)
}

.maps-link:hover {
  border-bottom-style: solid
}

.maps-link svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: var(--blue)
}

.maps-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px
}

/* --- Triángulo de incidencia --- */
.inc-tri {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: color .15s, background .15s, transform .15s
}

.inc-tri:hover {
  background: rgba(0, 0, 0, .08);
  color: var(--amber);
  transform: scale(1.25)
}

.inc-tri--on {
  color: var(--amber)
}

.inc-tri svg {
  width: 15px;
  height: 15px
}

/* --- Incidencias modal --- */
.inc-other-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft)
}

.inc-other-row:last-child {
  border-bottom: none
}

.inc-who {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  min-width: 80px;
  flex-shrink: 0;
  padding-top: 1px
}

.inc-txt {
  flex: 1;
  font-size: 13px;
  color: var(--ink);
  word-break: break-word
}

.inc-badges-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 4px
}

/* Tarjetas de incidencias */
.inc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 4px 0
}

.inc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  display: flex;
  flex-direction: column;
  gap: 7px
}

.inc-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
  border-color: var(--teal)
}

.inc-card--warn {
  border-left: 3px solid #dc2626
}

.inc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px
}

.inc-card-doc {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink)
}

.inc-card-date {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap
}

.inc-card-user {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal)
}

.inc-card-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap
}

.inc-card-obs {
  font-size: 13px;
  color: var(--ink-soft);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word
}

.inc-card-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px
}

/* Preguntas Sí/No del modal */
.inc-qs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px
}

.inc-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.inc-q-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink)
}

.inc-q-opts {
  display: flex;
  gap: 8px
}

.inc-opt {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer
}

.inc-opt input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0
}

.inc-opt span {
  padding: 5px 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
  background: var(--card)
}

.inc-opt input[type=radio]:checked+span {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff
}

.inc-opt:hover span {
  border-color: var(--teal);
  color: var(--teal)
}

/* Badges en tabla y modal */
.inc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700
}

.inc-badge.inc-yes {
  background: var(--green-50, #dcfce7);
  color: var(--green, #16a34a)
}

.inc-badge.inc-no {
  background: #fee2e2;
  color: #dc2626
}

.inc-badge.inc-na {
  background: var(--line-soft);
  color: var(--ink-soft)
}

.inc-badge-photo {
  background: #dbeafe;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  gap: 4px
}

/* --- Tabla de incidencias --- */
.inc-th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2)
}

.inc-td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  font-size: 14px
}

.inc-row:last-child .inc-td {
  border-bottom: none
}

.inc-text-cell {
  word-break: break-word;
  max-width: 300px
}

.entry .info-txt {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin: 2px 0
}

.entry .notas-txt {
  font-size: 11px;
  color: var(--ink-soft);
  font-style: italic;
  background: rgba(0, 0, 0, .05);
  padding: 3px 6px;
  border-radius: 6px;
  margin-top: 4px;
  word-break: break-word
}

/* --- Modal de detalle --- */
.detail-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px
}

.pill-done {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green)
}

.pill-pend {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-soft)
}

.detail-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start
}

.detail-row:last-of-type {
  border-bottom: none
}

.detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  min-width: 96px;
  flex-shrink: 0;
  padding-top: 2px
}

.detail-val {
  font-size: 14px;
  color: var(--ink);
  word-break: break-word;
  flex: 1
}

.detail-val.mono {
  font-family: var(--ff-mono);
  font-size: 13px
}

.detail-notas {
  font-style: italic;
  color: var(--ink-soft)
}

.detail-val svg {
  width: 13px;
  height: 13px;
  vertical-align: middle
}

/* Enlace de llamada en tarjeta */
.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--teal);
  text-decoration: none;
  font-weight: 600
}

.phone-link:hover {
  text-decoration: underline
}

.phone-link svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0
}

/* Botón de llamada en modal de detalle */
.phone-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--teal-50);
  border: 1px solid var(--teal-300);
  font-size: 14px;
  transition: background .15s, box-shadow .15s
}

.phone-call-btn:hover {
  background: #c6ede5;
  box-shadow: var(--shadow)
}

.phone-call-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0
}

/* WhatsApp — en tarjeta */
.phone-row {
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.wa-link {
  display: inline-flex;
  align-items: center;
  color: #25d366;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background .15s, transform .12s
}

.wa-link:hover {
  background: #e8fdf2;
  transform: scale(1.15)
}

.wa-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0
}

/* WhatsApp — en modal de detalle */
.detail-phone-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #25d366;
  font-weight: 700;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  background: #e8fdf2;
  border: 1px solid #86efac;
  font-size: 14px;
  transition: background .15s, box-shadow .15s
}

.wa-btn:hover {
  background: #c6fadb;
  box-shadow: var(--shadow)
}

.wa-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0
}

/* Separador en mapeo de columnas */
.ef-sep {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin: 6px 0 2px
}

.ef-sep::before,
.ef-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line)
}

/* Filas de columnas personalizadas en ajustes */
.ef-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft)
}

.ef-row:last-child {
  border-bottom: none
}

.entry .acts {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  gap: 2px
}

.entry:hover .acts {
  display: flex
}

.entry .acts button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  padding: 0
}

.entry .acts button svg {
  width: 13px;
  height: 13px
}

.entry .acts button:hover {
  background: var(--paper)
}

.entry .acts .del:hover {
  background: var(--danger-50);
  color: var(--danger);
  border-color: #f0c5bf
}

/* ---------- Importar ---------- */
.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600
}

.step .n {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--line-soft);
  font-size: 12px;
  font-weight: 700
}

.step.active .n {
  background: var(--teal);
  color: #fff
}

.step.done .n {
  background: var(--green);
  color: #fff
}

.step+.step::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--line);
  margin-right: 2px
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow)
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  background: var(--paper-2);
  transition: border-color .15s, background .15s;
  cursor: pointer
}

.dropzone.drag {
  border-color: var(--teal);
  background: var(--teal-50)
}

.dropzone svg {
  width: 40px;
  height: 40px;
  color: var(--teal);
  opacity: .8
}

.dropzone h3 {
  margin: 12px 0 4px;
  font-size: 18px
}

.dropzone p {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0
}

.dropzone .file-name {
  margin-top: 10px;
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--teal)
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px
}

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card)
}

table.grid {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px
}

table.grid th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  position: sticky;
  top: 0;
  font-weight: 700;
  white-space: nowrap
}

table.grid td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle
}

table.grid tr.bad td {
  background: var(--danger-50)
}

table.grid .input {
  padding: 7px 9px;
  font-size: 13.5px
}

table.grid input[type=date].input {
  min-width: 140px
}

.row-del {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 6px;
  border-radius: 8px
}

.row-del:hover {
  background: var(--danger-50);
  color: var(--danger)
}

/* ---------- Ajustes ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: 188px 1fr;
  gap: 24px;
  max-width: 1160px;
  margin: 0 auto;
  align-items: start;
  padding: 0 16px 40px
}

.settings-nav {
  position: sticky;
  top: 72px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.sn-link {
  display: block;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background .15s, color .15s;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
  background: none;
  width: 100%;
  text-align: left
}

.sn-link:hover {
  background: var(--teal-50);
  color: var(--teal)
}

.sn-link.sn-active {
  background: var(--teal);
  color: #fff;
  font-weight: 600
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px
}

.card[data-nav] {
  scroll-margin-top: 80px
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft)
}

.user-row:last-child {
  border-bottom: none
}

.user-row .av {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--teal-50);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-family: var(--ff-display);
  font-weight: 800
}

.user-row .info {
  flex: 1;
  min-width: 0
}

.user-row .info b {
  display: block
}

.user-row .info span {
  font-size: 12px;
  color: var(--ink-soft)
}

.note {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55
}

.note b {
  color: var(--ink)
}

.urole-btn {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap
}

.urole-btn:hover {
  border-color: var(--teal);
  color: var(--teal)
}

.urole-btn--active {
  border-color: var(--teal);
  background: var(--teal-50);
  color: var(--teal)
}

.kpi {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line)
}

.kpi.ok {
  background: var(--green-50);
  color: var(--green);
  border-color: #bfe3c9
}

.kpi.warn {
  background: var(--amber-50);
  color: var(--amber);
  border-color: #eccfa6
}

/* ---------- Modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 32, 29, .45);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
  animation: fade .2s ease both
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 24px;
  animation: rise .3s cubic-bezier(.2, .8, .2, 1) both;
  max-height: 92dvh;
  overflow: auto
}

.modal h3 {
  font-size: 20px;
  margin-bottom: 16px
}

.modal .row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 80;
  pointer-events: none
}

.toast {
  background: var(--teal-700);
  color: #eafff8;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: rise .25s ease both;
  pointer-events: auto
}

.toast.bad {
  background: var(--danger)
}

/* ---------- Util ---------- */
.muted {
  color: var(--ink-soft)
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft)
}

.empty-state svg {
  width: 46px;
  height: 46px;
  opacity: .5;
  margin-bottom: 10px
}

.sep {
  height: 1px;
  background: var(--line-soft);
  margin: 18px 0
}

.flex {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap
}

.grow {
  flex: 1
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@keyframes fade {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

/* ===========================================================
   RESPONSIVE — tablets (≤880px)
   =========================================================== */
@media (max-width:880px) {

  /* Sidebar → barra superior */
  .shell {
    flex-direction: column
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
    z-index: 30;
  }

  .sidebar .brand {
    margin-bottom: 0;
    flex: 1
  }

  .sidebar .brand .sub {
    display: none
  }

  .nav {
    display: none
  }

  .side-foot {
    margin: 0;
    border: none;
    padding: 0
  }

  .side-foot .who {
    margin: 0
  }

  .who .meta {
    display: none
  }

  .side-foot .btn {
    display: none
  }

  /* Navegación inferior fija */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--teal-700);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
    box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, .4);
  }

  .mobile-nav button {
    flex: 1;
    background: transparent;
    border: none;
    color: #9fc9bf;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px;
    border-radius: 10px;
  }

  .mobile-nav button svg {
    width: 21px;
    height: 21px
  }

  .mobile-nav button.active {
    color: #eafff8
  }

  .content {
    padding: 18px 14px 92px
  }

  /* Semana en 2 columnas en tablet */
  .week-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px
  }

  .day-col {
    min-height: 0
  }

  /* Acciones siempre visibles */
  .entry .acts {
    display: flex;
    position: static;
    margin-top: 8px;
    justify-content: flex-end
  }

  /* Barra del calendario */
  .cal-toolbar .week-label {
    min-width: 0;
    flex: 1
  }

  .search input {
    width: 100%
  }

  .search {
    flex: 1
  }

  /* Usuarios en ajustes */
  .user-row {
    flex-wrap: wrap;
    gap: 8px
  }
}

@media (min-width:881px) {
  .mobile-nav {
    display: none
  }
}

/* ---- FAB ajustes + bottom sheet ---- */
.sn-fab {
  display: none;
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 46;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: 0 4px 20px rgba(15,118,110,.45);
  cursor: pointer;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s
}
.sn-fab:active {
  transform: translateX(-50%) scale(.95);
  box-shadow: 0 2px 10px rgba(15,118,110,.3)
}
@media(max-width:880px){.sn-fab{display:flex}}

.sn-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(10,42,38,.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px)
}
.sn-overlay.open { display: block }
.sn-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 0 0 calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.32,.72,0,1);
  max-height: 78vh;
  display: flex;
  flex-direction: column
}
.sn-overlay.open .sn-sheet { transform: translateY(0) }
.sn-sheet-handle {
  width: 38px; height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 14px auto 0;
  flex-shrink: 0
}
.sn-sheet-head {
  padding: 14px 20px 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft)
}
.sn-sheet-body {
  overflow-y: auto;
  padding: 8px 10px;
  -webkit-overflow-scrolling: touch
}
.sn-sheet-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
  gap: 10px
}
.sn-sheet-link:active { background: var(--teal-50); color: var(--teal) }
.sn-sheet-link.sn-active {
  background: var(--teal-50);
  color: var(--teal);
  font-weight: 700
}
.sn-sheet-link::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
  transition: background .12s
}
.sn-sheet-link.sn-active::before { background: var(--teal) }

/* ---- FAB escáner ---- */
.mob-scan-fab {
  display: none;
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom));
  right: 16px;
  z-index: 48;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
}

.mob-scan-fab:active {
  transform: scale(.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22)
}

@media(max-width:880px) {
  .mob-scan-fab {
    display: flex
  }
}

/* ---- Modal escáner ---- */
.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--paper-2, #f0f4f3);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
}

.scan-modal.scan-modal--open {
  transform: translateY(0)
}

.scan-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--teal-700);
  color: #fff;
  flex-shrink: 0;
}

.scan-modal-title {
  font-size: 16px;
  font-weight: 700
}

.scan-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  opacity: .8
}

.scan-modal-close:hover {
  opacity: 1
}

.scan-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto
}

/* Visor de cámara */
.scan-vw {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  max-height: 52vw
}

.scan-vw video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

.scan-frame-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none
}

.scan-frame {
  position: relative;
  width: 65%;
  max-width: 240px;
  height: 70px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .4);
  overflow: hidden
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(45, 212, 191, .9);
  animation: scanline 1.8s ease-in-out infinite
}

@keyframes scanline {

  0%,
  100% {
    top: 4px
  }

  50% {
    top: calc(100% - 6px)
  }
}

.scan-hint {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  pointer-events: none
}

/* Input manual */
.scan-manual-wrap {
  display: flex;
  gap: 8px
}

.scan-manual-wrap .input {
  flex: 1;
  font-size: 14px
}

/* Tarjeta resultado */
.scan-entry-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow)
}

.scan-entry-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px
}

.scan-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-soft)
}

.scan-badge--ok {
  background: #d1fae5;
  color: #065f46
}

.scan-badge--rep {
  background: #dbeafe;
  color: #1e40af
}

.scan-badge--prep {
  background: #fef3c7;
  color: #92400e
}

.scan-arts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px
}

.scan-art {
  font-family: var(--ff-mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 2px 7px;
  color: var(--ink-soft)
}

.scan-searching {
  padding: 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px
}

.scan-not-found {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft)
}

/* ---- Drawer móvil ---- */
.mob-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 149;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity .25s;
}

.mob-backdrop.mob-backdrop--open {
  display: block;
  opacity: 1
}

.mob-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 0 0 calc(12px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .22);
  max-height: 80vh;
  overflow-y: auto;
}

.mob-drawer.mob-drawer--open {
  transform: translateY(0)
}

.mob-drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 10px auto 0
}

.mob-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}

.mob-drawer-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em
}

.mob-drawer-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 2px 6px
}

.mob-drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 20px;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}

.mob-drawer-item:last-child {
  border-bottom: none
}

.mob-drawer-item:active,
.mob-drawer-item:hover {
  background: var(--bg)
}

.mob-drawer-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--teal)
}

.mob-drawer-item.active svg,
.mob-drawer-item.active {
  color: var(--teal);
  font-weight: 700
}

.mob-drawer-logout svg {
  color: #dc2626
}

.mob-drawer-logout {
  color: #dc2626
}

/* ===========================================================
   RESPONSIVE — teléfono móvil (≤600px)
   =========================================================== */
@media (max-width:600px) {

  /* Barra del calendario — dos filas */
  .cal-toolbar {
    gap: 8px
  }

  .cal-toolbar .week-label {
    min-width: 0;
    flex: 1;
    text-align: center;
    font-size: 14px
  }

  .cal-toolbar .spacer {
    display: none
  }

  /* Botones de navegación de semana más grandes */
  .cal-toolbar .btn-icon {
    width: 40px;
    height: 40px
  }

  /* Búsqueda en segunda fila ocupando todo el ancho */
  .cal-toolbar .search {
    order: 10;
    flex: 1 1 100%
  }

  .cal-toolbar .search input {
    width: 100%
  }

  /* Botón añadir: solo icono en móvil */
  .cal-toolbar #add span {
    display: none
  }

  .cal-toolbar #add {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px
  }

  /* Tarjetas más compactas con mejor jerarquía visual */
  .entry {
    padding: 10px 11px
  }

  .entry .doc {
    font-size: 13px
  }

  .entry .prod {
    font-size: 14px;
    font-weight: 700
  }

  .checklist {
    gap: 0;
    margin-top: 10px;
    padding-top: 10px
  }

  /* Targets táctiles más grandes en checklist */
  .chk-label {
    font-size: 13px;
    padding: 5px 0
  }

  .chk-label input[type=checkbox] {
    width: 17px;
    height: 17px
  }

  /* Contenido general */
  .content {
    padding: 12px 10px 88px
  }

  .page-head {
    margin-bottom: 14px
  }

  /* Modal a pantalla completa */
  .overlay {
    padding: 0;
    align-items: flex-end
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 20px 16px 28px;
    max-height: 90dvh
  }

  /* Modal centrado (no bottom-sheet) */
  .overlay--center {
    padding: 18px;
    align-items: center
  }

  .overlay--center .modal {
    border-radius: var(--radius);
    max-width: 460px
  }

  /* Botones de teléfono y WhatsApp a ancho completo en modal */
  .detail-phone-row {
    flex-direction: column;
    align-items: stretch
  }

  .phone-call-btn,
  .wa-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 15px
  }

  /* Ajustes: ocultar sidebar, layout de columna única */
  .map-grid {
    grid-template-columns: 1fr
  }

  .settings-layout {
    grid-template-columns: 1fr;
    padding: 0 0 40px;
    gap: 0;
    /* Salir del padding del content para que el contenido sea full-width */
    margin: -18px -14px 0
  }

  .settings-nav {
    display: none
  }

  .settings-grid {
    gap: 12px;
    padding: 14px 14px 0;
    overflow-x: hidden
  }

  .card[data-nav] {
    scroll-margin-top: 80px
  }

  /* Logo pequeño en el topbar móvil */
  .sidebar .brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 8px
  }

  .sidebar .brand h1 {
    font-size: 17px
  }

  .user-row {
    flex-wrap: wrap;
    gap: 8px
  }

  .user-row .role-sel {
    flex: 1
  }

  /* Importar: pasos */
  .steps {
    gap: 4px
  }

  .step {
    font-size: 12px
  }
}

/* ===========================================================
   MANUAL — diseño responsive atractivo
   =========================================================== */

/* --- Vista de lectura --- */
.manual-view {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 32px
}

.manual-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px
}

.manual-empty svg {
  width: 48px;
  height: 48px;
  opacity: .3
}

.manual-empty p {
  font-size: 15px;
  margin: 0
}

/* Título principal (H2) */
.manual-h2 {
  font-family: var(--ff-display);
  font-size: clamp(19px, 4vw, 25px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 40px 0 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
  position: relative;
}

.manual-h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 44px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
}

.manual-h2:first-child {
  margin-top: 0
}

/* Subtítulo (H3) */
.manual-h3 {
  font-family: var(--ff-display);
  font-size: clamp(14px, 3vw, 17px);
  font-weight: 700;
  color: var(--teal);
  margin: 26px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.manual-h3::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--teal);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Párrafo */
.manual-p {
  font-size: clamp(14px, 2.5vw, 15px);
  line-height: 1.85;
  color: var(--ink);
  margin: 0 0 18px;
  white-space: pre-wrap;
}

/* Imagen con pie de foto */
.manual-fig {
  margin: 24px 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.manual-img {
  width: 100%;
  display: block;
  max-height: 520px;
  object-fit: contain;
  background: var(--paper);
  padding: 8px;
}

.manual-fig-cap {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-style: italic;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

/* --- Editor de bloques --- */
.manual-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.manual-empty-edit {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 14px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}

.blk-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal-300);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(22, 32, 29, .06);
  transition: box-shadow .15s;
}

.blk-card:focus-within {
  box-shadow: var(--shadow)
}

.blk-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

.blk-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--teal-50);
  color: var(--teal);
  flex-shrink: 0;
}

.blk-mv,
.blk-del {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  font-size: 15px;
  color: var(--ink-soft);
  transition: background .15s, color .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blk-mv:hover:not(:disabled) {
  background: var(--line-soft);
  color: var(--ink)
}

.blk-mv:disabled {
  opacity: .25;
  cursor: default
}

.blk-del svg {
  width: 14px;
  height: 14px
}

.blk-del:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5
}

.blk-img-area {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.blk-img-prev {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: block;
}

.blk-upload-lbl {
  display: block;
  cursor: pointer;
  padding: 14px;
  border: 2px dashed var(--teal-300);
  border-radius: 10px;
  color: var(--teal);
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  transition: background .15s, border-color .15s;
}

.blk-upload-lbl:hover {
  background: var(--teal-50);
  border-color: var(--teal)
}

/* Barra añadir bloque */
.manual-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 14px auto 0;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.manual-add-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

/* Responsive móvil */
@media (max-width:600px) {
  .manual-view {
    padding-bottom: 24px
  }

  .manual-h2 {
    font-size: 19px;
    margin: 28px 0 10px
  }

  .manual-h3 {
    font-size: 14px;
    margin: 20px 0 6px
  }

  .manual-p {
    font-size: 14px;
    line-height: 1.75
  }

  .manual-fig {
    margin: 16px 0
  }

  .manual-add-row {
    gap: 6px
  }

  .manual-add-lbl {
    width: 100%
  }

  .blk-card {
    padding: 10px 12px
  }

  .blk-mv,
  .blk-del {
    width: 38px;
    height: 38px
  }
}

/* ===========================================================
   PANEL DE INFORMACIÓN DIARIA
   =========================================================== */
.info-strip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center
}

.info-strip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--paper-2);
  cursor: pointer;
  user-select: none;
  flex: 1;
  min-width: 0;
  border: none;
  text-align: left;
  font: inherit;
  color: inherit
}

.info-strip-head:hover {
  background: var(--line-soft)
}

.info-chevron {
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: transform .22s;
  transform: rotate(0deg)
}

.info-strip.info-open .info-chevron {
  transform: rotate(90deg)
}

.info-strip-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  flex: 1
}

.info-strip-search {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--paper-2);
  border-left: 1px solid var(--line-soft)
}

.info-strip-search svg {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--ink-soft);
  pointer-events: none
}

.info-strip-search .input {
  padding: 4px 10px 4px 28px;
  font-size: 12.5px;
  height: 30px;
  width: 190px
}

/* Cuerpo plegado por defecto */
.info-strip-body {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line-soft);
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease
}

.info-strip.info-open .info-strip-body {
  max-height: 200px
}

.info-day-row {
  padding: 8px 10px;
  border-right: 1px solid var(--line-soft);
  transition: background .15s, opacity .15s
}

.info-day-row:last-child {
  border-right: none
}

.info-day-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 3px
}

.info-day-txt {
  font-size: 11.5px;
  color: var(--ink);
  line-height: 1.4;
  word-break: break-word
}

.info-day-empty {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 11px
}

.info-day-row.info-match {
  background: #dde8fb
}

.info-day-row.info-no-match {
  opacity: .25
}

/* Ajustes: días visibles */
.vd-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px
}

.vd-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  user-select: none;
  transition: background .15s
}

.vd-label:has(input:checked) {
  background: var(--teal-50);
  border-color: var(--teal);
  color: var(--teal)
}

.vd-label input[type=checkbox] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--teal);
  flex-shrink: 0
}

/* Ajustes: cuadrícula de edición del panel info */
.info-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 4px
}

.ip-vis-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft)
}

.ip-vis-toggle input {
  accent-color: var(--teal);
  width: 14px;
  height: 14px;
  cursor: pointer
}

.ip-vis-toggle:has(input:checked) .ip-vis-label {
  color: var(--teal)
}

@media (max-width:880px) {
  .info-strip-body {
    grid-template-columns: repeat(4, 1fr)
  }

  .info-strip-search .input {
    width: 140px
  }
}

@media (max-width:600px) {

  /* Panel de info: apilado vertical */
  .info-strip {
    flex-direction: column;
    align-items: stretch
  }

  /* Búsqueda: visible, a ancho completo */
  .info-strip-search {
    display: flex;
    border-left: none;
    border-top: 1px solid var(--line-soft);
    padding: 8px 12px
  }

  .info-strip-search .input {
    width: 100%;
    padding-left: 32px
  }

  /* Cuerpo: una sola columna */
  .info-strip-body {
    grid-template-columns: 1fr
  }

  .info-strip.info-open .info-strip-body {
    max-height: 380px;
    overflow-y: auto
  }

  /* Cada fila: etiqueta día + texto en horizontal */
  .info-day-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid var(--line-soft)
  }

  .info-day-row:last-child {
    border-bottom: none
  }

  .info-day-lbl {
    font-size: 10px;
    font-weight: 800;
    min-width: 32px;
    text-align: center;
    background: var(--line-soft);
    color: var(--ink-soft);
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-bottom: 0;
    margin-top: 3px;
    display: inline-block
  }

  .info-day-txt {
    font-size: 13.5px;
    line-height: 1.5
  }

  /* Ajustes */
  .info-edit-grid {
    grid-template-columns: 1fr 1fr
  }
}

/* ===========================================================
   DÍAS FESTIVOS EN CALENDARIO
   =========================================================== */
.day-col.festivo {
  border-color: #dc2626;
  border-width: 2px
}

.day-col.festivo .day-head {
  background: #dc2626;
  border-bottom-color: #b91c1c
}

.day-col.festivo .day-head .dow {
  color: #fff;
  font-weight: 900
}

.day-col.festivo .day-head .dnum {
  color: #fff;
  font-weight: 900
}

.day-col.festivo .day-head .count {
  background: rgba(0, 0, 0, .25);
  color: #fff
}

.day-col.festivo .day-head .day-add-btn {
  color: #fff
}

.day-col.festivo .day-head .day-add-btn:hover {
  background: rgba(0, 0, 0, .25);
  color: #fff
}

.day-col.festivo .day-body {
  background: #fff5f5
}

.festivo-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  color: #fff;
  letter-spacing: .06em;
  margin-left: 5px;
  vertical-align: middle;
  text-transform: uppercase
}

/* ===========================================================
   CALENDARIO MÓVIL — barra de pestañas + día único
   =========================================================== */
.mob-cal {
  display: flex;
  flex-direction: column;
  gap: 0
}

/* Barra de pestañas */
.mob-strip {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 6px 0;
  gap: 3px;
}

.mob-strip::-webkit-scrollbar {
  display: none
}

.mob-tab-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 44px
}

.mob-tab-add {
  font-size: 13px;
  padding: 1px 4px;
  margin-bottom: 4px;
  border-radius: 6px;
  opacity: .45;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-soft)
}

.mob-tab-add:hover {
  opacity: 1;
  background: var(--teal-50);
  color: var(--teal)
}

/* Pestaña individual */
.mob-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  width: 100%;
  position: relative;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}

.mob-tab:active {
  background: var(--line-soft)
}

/* Texto de día abreviado */
.mob-tab-dow {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-soft);
  line-height: 1;
}

/* Número del día */
.mob-tab-dnum {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: 21px;
  color: var(--ink);
  line-height: 1;
}

/* Contador de envíos */
.mob-tab-cnt {
  font-size: 10px;
  font-weight: 700;
  min-height: 15px;
  min-width: 18px;
  text-align: center;
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  padding: 0 5px;
  line-height: 15px;
}

.mob-tab-cnt--empty {
  background: transparent;
  opacity: 0
}

/* Pestaña activa */
.mob-tab--active {
  background: var(--paper-2)
}

.mob-tab--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 4px;
  height: 3px;
  background: var(--teal);
  border-radius: 2px 2px 0 0;
}

.mob-tab--active .mob-tab-dnum {
  color: var(--teal)
}

.mob-tab--active .mob-tab-dow {
  color: var(--teal)
}

/* Pestaña — hoy (no activo) */
.mob-tab--today:not(.mob-tab--active) .mob-tab-dnum {
  color: var(--teal);
  opacity: .65
}

/* Pestaña — festivo */
.mob-tab--festivo .mob-tab-dnum {
  color: #dc2626
}

.mob-tab--festivo .mob-tab-dow {
  color: #dc2626
}

.mob-tab--festivo .mob-tab-cnt {
  background: #dc2626
}

.mob-tab--active.mob-tab--festivo::after {
  background: #dc2626
}

/* Área de contenido del día seleccionado */
.mob-day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.mob-day.today {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal-50)
}

.mob-day.festivo {
  border-color: #dc2626;
  border-width: 2px
}

/* Cabecera del día en móvil — más generosa */
.mob-day-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mob-dow-full {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-soft);
  margin-bottom: 2px;
}

.mob-dnum-full {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
}

.mob-month {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-soft)
}

.mob-count-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-50);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.mob-day.today .mob-dnum-full {
  color: var(--teal)
}

.mob-day.festivo .mob-day-head {
  background: #dc2626
}

.mob-day.festivo .mob-dow-full {
  color: rgba(255, 255, 255, .85)
}

.mob-day.festivo .mob-dnum-full {
  color: #fff
}

.mob-day.festivo .mob-month {
  color: rgba(255, 255, 255, .75)
}

.mob-day.festivo .mob-count-badge {
  background: rgba(0, 0, 0, .2);
  color: #fff
}

.mob-day.festivo .day-body {
  background: #fff5f5
}

/* ===========================================================
   PRECIOS
   =========================================================== */

/* Barra de admin: selección de roles */
.prices-admin-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 18px;
}

.prices-vis-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap
}

.prices-vis-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0
}

/* ===========================================================
   ALMACÉN LOGÍSTICO
   =========================================================== */
.log-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 18px
}

.log-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 0;
  transition: color .15s
}

.log-tab:hover {
  color: var(--teal)
}

.log-tab--active {
  color: var(--teal);
  border-bottom-color: var(--teal)
}

.log-stock-status {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px
}

.log-stock-ok {
  background: var(--green-50);
  border: 1px solid #bbf0cf
}

.log-stock-empty {
  background: var(--paper);
  border: 1px solid var(--line)
}

.log-paste-area {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--ff-mono);
  font-size: 12px;
  resize: vertical;
  background: var(--paper-2);
  color: var(--ink);
  margin-top: 8px
}

.log-paste-area:focus {
  outline: none;
  border-color: var(--teal)
}

.log-field-map {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px
}

.log-field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap
}

.log-field-label {
  min-width: 200px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft)
}

.log-required {
  color: var(--teal)
}

.log-field-sel {
  max-width: 280px;
  flex: 1;
  min-width: 160px
}

.log-prev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px
}

.log-prev-table th {
  background: var(--paper);
  font-weight: 700;
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap
}

.log-prev-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line-soft)
}

.log-td-modelo {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.log-week-nav {
  margin-bottom: 12px
}

.log-week-label {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--ff-mono)
}

.log-day-card {
  margin-bottom: 12px
}

.log-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px
}

.log-day-head h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0
}

.log-doc-block {
  border-top: 1px solid var(--line-soft);
  padding: 8px 0 4px
}

.log-doc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px
}

.log-doc-num {
  font-family: var(--ff-mono);
  font-size: 12px;
  font-weight: 700;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px
}

.log-art-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12.5px;
  margin-bottom: 3px
}

.log-art-ok {
  background: var(--teal-50)
}

.log-art-missing {
  background: var(--amber-50)
}

.log-art-ref {
  font-family: var(--ff-mono);
  font-weight: 700;
  font-size: 12px;
  min-width: 70px
}

.log-art-palet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700
}

.log-art-marca {
  font-size: 12px;
  font-weight: 600
}

.log-art-modelo {
  flex: 1;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px
}

.log-art-cant {
  font-size: 11px;
  background: var(--teal);
  color: #fff;
  border-radius: 5px;
  padding: 1px 7px;
  font-weight: 700;
  white-space: nowrap
}

.log-art-warn {
  font-size: 12px;
  color: var(--amber);
  font-weight: 600
}

.log-art-block {
  margin-bottom: 6px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--line)
}

.log-art-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: #d1fae5;
  font-size: 12.5px;
  font-weight: 600
}

.log-needed {
  font-family: var(--ff-mono);
  font-size: 11px;
  background: #059669;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px
}

.log-pallet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 3px 8px;
  font-size: 12px;
  background: var(--paper)
}

.log-pallet-row:nth-child(even) {
  filter: brightness(0.97)
}

.log-take {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  margin-left: auto
}

.log-shortage {
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border-top: 1px solid #fde68a
}

.log-insuf-warn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #991b1b;
  background: #fee2e2;
  border-radius: 6px;
  margin-top: 4px
}

.log-art-insuf {
  opacity: .8;
  border-left: 3px solid #ef4444;
  padding-left: 4px
}

.prices-roles-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

/* ── Fotos de incidencias ─────────────────────────────── */
.inc-photos-wrap {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px
}

.inc-photos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px
}

.inc-photos-label {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px
}

.inc-photo-add-lbl {
  position: relative;
  cursor: pointer;
  overflow: hidden
}

.inc-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  min-height: 32px
}

.inc-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer
}

.inc-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter .15s
}

.inc-photo-thumb:hover img {
  filter: brightness(.75)
}

.inc-photo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s
}

.inc-photo-thumb:hover .inc-photo-overlay {
  opacity: 1
}

.inc-photo-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0
}

.inc-photo-btn svg {
  width: 14px;
  height: 14px;
  stroke: #fff
}

.inc-photo-btn:hover {
  background: rgba(0, 0, 0, .8)
}

/* Modal de consentimiento de fotografía */
.photo-consent-dlg {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px)
}

.photo-consent-box {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25)
}

.photo-consent-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--teal)
}

.photo-consent-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.5
}

.photo-consent-box h4 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700
}

.photo-consent-box p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0
}

.photo-del-code-display {
  margin-top: 14px;
  font-family: var(--ff-mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 10px;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 10px;
  padding: 10px 0;
  user-select: none
}

/* Lightbox */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center
}

.photo-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(4px)
}

.photo-lb-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 900px);
  max-height: 92vh
}

.photo-lb-img {
  max-width: 100%;
  max-height: calc(92vh - 80px);
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6)
}

.photo-lb-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center
}

.photo-lb-close:hover {
  background: rgba(255, 255, 255, .32)
}

.photo-lb-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3)
}

.photo-lb-dl:hover {
  background: rgba(255, 255, 255, .25)
}

.photo-lb-dl svg {
  width: 14px;
  height: 14px
}

.prices-role-chk {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  user-select: none;
  transition: border-color .15s, background .15s;
}

.prices-role-chk input[type=checkbox] {
  accent-color: var(--teal);
  cursor: pointer;
  width: 14px;
  height: 14px
}

.prices-role-chk:has(input:checked) {
  border-color: var(--teal);
  background: rgba(45, 212, 191, .1)
}

.prices-role-chk--locked {
  opacity: .6;
  cursor: default
}

.prices-role-chk--locked input {
  cursor: default
}

/* Encabezado de categoría */
.prices-cat-head {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}

.prices-cat-head:first-child {
  margin-top: 0
}

/* Cuadrícula de tarjetas */
.prices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

/* Tarjeta de precio */
.price-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .12s;
}

.price-card:hover {
  box-shadow: 0 4px 20px -8px rgba(22, 32, 29, .22);
  transform: translateY(-1px)
}

/* Badge de categoría dentro de la tarjeta */
.price-cat-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--teal-50);
  color: var(--teal);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 2px;
  width: fit-content;
}

/* Nombre */
.price-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3
}

/* Descripción */
.price-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  flex: 1
}

/* Precio destacado */
.price-amount {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--teal);
  margin-top: 4px;
}

/* Acciones de admin */
.price-acts {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft)
}

.price-acts .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.price-acts .btn-sm svg {
  width: 12px;
  height: 12px
}

/* Estado vacío */
.prices-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.prices-empty svg {
  width: 44px;
  height: 44px;
  opacity: .25
}

.prices-empty p {
  font-size: 15px;
  margin: 0
}

/* Responsive móvil */
@media (max-width:600px) {
  .prices-grid {
    grid-template-columns: 1fr
  }

  .price-amount {
    font-size: 20px
  }

  .prices-admin-bar {
    flex-wrap: wrap;
    gap: 10px
  }
}

/* ============================================================
   ENTREGAS
   ============================================================ */
.et-card {
  padding: 14px 16px
}

.et-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px
}

.et-doc {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink)
}

.et-date {
  font-size: 12px;
  color: var(--ink-soft);
  margin-left: auto
}

.et-product {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px
}

/* Artículos con checkboxes */
.et-arts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px
}

.et-art-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .12s
}

.et-art-row:hover {
  background: var(--bg)
}

.et-art-row input[type=checkbox] {
  accent-color: var(--teal);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0
}

.et-art-row.et-art-locked {
  opacity: .5;
  cursor: not-allowed
}

.et-art-row.et-art-locked input {
  cursor: not-allowed
}

.et-verify-hint {
  font-size: 12px;
  color: var(--amber);
  background: var(--amber-50);
  border-radius: 7px;
  padding: 6px 10px;
  margin: 6px 0 2px
}

.et-scan-btn--required {
  background: var(--teal) !important;
  color: #fff !important;
  border-color: var(--teal) !important
}

.et-art-ref {
  font-family: var(--ff-mono);
  font-size: 12.5px;
  color: var(--ink);
  flex: 1
}

.et-art-ok {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap
}

/* Botones de acción en tarjeta */
.et-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

/* Escáner de código de barras */
.et-scan-box {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 14px;
  margin: 10px 0 0
}

.et-scan-video-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  margin-bottom: 10px
}

.et-scan-video {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: cover
}

.et-scan-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none
}

.et-scan-frame::after {
  content: '';
  display: block;
  width: 72%;
  max-width: 260px;
  height: 56px;
  border: 2px solid rgba(255, 255, 255, .75);
  border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .38)
}

.et-scan-detected {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 180, 100, .18);
  backdrop-filter: blur(2px);
  color: #4ade80;
  font-size: 18px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5)
}

/* Pestaña de entregados */
.et-del-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px
}

.et-del-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow)
}

.et-del-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px
}

.et-del-photos {
  margin: 0
}

.et-del-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer
}

.et-done-banner {
  background: var(--teal);
  color: #fff;
  text-align: center;
  padding: 9px 14px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  margin: -2px -2px 0;
  border: none
}

/* Finalizar/PDF — lista de documentos con check */
.ef-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px
}

.ef-chk-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink)
}

.ef-doc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 55vh;
  overflow-y: auto
}

.ef-doc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  border: 1px solid var(--border)
}

.ef-doc-row:hover {
  background: var(--hover)
}

.ef-doc-row input[type=checkbox] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--teal);
  cursor: pointer
}

.ef-doc-num {
  font-family: var(--ff-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.ef-doc-date {
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap
}

.ef-doc-imp {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
  font-family: var(--ff-mono)
}

.ef-pending-warn {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap
}

.ef-doc-done {
  cursor: default;
  opacity: .6;
  background: var(--hover)
}

.ef-done-chk {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--teal);
  font-weight: 700;
  font-size: 14px;
  text-align: center
}

.ef-badge.ef-fin {
  background: #ede9fe;
  color: #5b21b6
}

.ef-sum-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--teal);
  border-radius: 10px;
  color: #fff
}

.ef-sum-label {
  font-size: 12px;
  font-weight: 600;
  opacity: .85
}

.ef-sum-val {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--ff-mono);
  flex: 1
}

.ef-sum-count {
  font-size: 12px;
  font-weight: 600;
  opacity: .8;
  white-space: nowrap
}

.ef-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap
}

.ef-badge.ef-ok {
  background: #d1fae5;
  color: #065f46
}

.ef-badge.ef-rep {
  background: #dbeafe;
  color: #1e40af
}

.ef-badge.ef-pend {
  background: #f3f4f6;
  color: #6b7280
}

/* Modal de confirmación de entrega */
.et-confirm-box {
  background: var(--card);
  border-radius: 18px;
  padding: 28px 24px 24px;
  max-width: 360px;
  width: 92%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .28);
}

.et-confirm-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--teal)
}

.et-confirm-box h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--ink)
}

.et-confirm-warn {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
  text-align: left;
}

.et-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.et-confirm-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.et-confirm-row .btn {
  flex: 1;
  justify-content: center;
  font-size: 13px;
  padding: 9px 12px
}

.et-confirm-photos {
  background: var(--teal) !important;
  color: #fff !important;
  gap: 6px
}

.et-confirm-photos svg {
  width: 15px;
  height: 15px
}

@media(max-width:600px) {
  .et-del-grid {
    grid-template-columns: 1fr
  }

  .et-date {
    margin-left: 0;
    width: 100%
  }
}

/* ── Superadmin panel ── */
.sa-tienda-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.sa-tienda-row:last-child { border-bottom: none; }
.sa-tienda-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sa-tienda-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sa-tienda-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.sa-lic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.sa-lic-table th,
.sa-lic-table td {
  text-align: left;
  padding: 6px 8px;
  border: 1px solid var(--border);
}
.sa-lic-table th {
  background: var(--surface-alt, var(--surface));
  font-weight: 600;
}
.sa-lic-code {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
}
@media(max-width:600px) {
  .sa-tienda-row { flex-direction: column; align-items: flex-start; }
  .sa-tienda-btns { width: 100%; }
  .sa-lic-table { font-size: 11px; }
}