/* ══════════════════════════════════════════
   TOKENS
══════════════════════════════════════════ */
:root {
  --bg:     #f5f5f5;
  --card:   #ffffff;
  --text:   #000000;
  --muted:  rgba(0, 0, 0, 0.55);
  --border: rgba(0, 0, 0, 0.08);
  --blue:   #0000ff;
  --blue-hover: #333333;
  --green:  #0a7d4e;
  --green-rgb: 10, 125, 78;
  --red:    #d61f1f;
  --orange: #f59e0b;
}

.lang-toggle { position: fixed; top: 20px; right: 20px; display: flex; gap: 2px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px; z-index: 210; }
.lang-btn { border: none; background: none; padding: 5px 12px; border-radius: 999px; font-size: 10px; font-weight: 800; color: var(--muted); cursor: pointer; font-family: Helvetica, Arial, sans-serif; transition: background-color .15s, color .15s; }
.lang-btn.active { background: var(--blue); color: #fff; }

/* ══════════════════════════════════════════
   BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  padding: 32px 20px 60px;
  font-variant-numeric: tabular-nums;
  font-size: 14px; line-height: 1.5;
}

.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.container { max-width: 1400px; margin: auto; }

.three-col {
  display: grid;
  grid-template-columns: 230px 1fr 1fr;
  gap: 0 20px; align-items: start;
  min-height: calc(100vh - 120px);
}

.col-ferias  { position: sticky; top: 20px; }
.col-stock   { min-height: calc(100vh - 120px); }
.col-reparto { min-height: calc(100vh - 120px); }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.minimal-header { margin-bottom: 28px; text-align: center; }
.app-title { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; }

.app-subtitle-text {
  margin: 10px auto 0; max-width: 768px;
  font-size: 12px; color: var(--muted); line-height: 1.6;
}

.app-howto-toggle {
  margin: 10px auto 0;
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px; font-weight: 700; color: var(--blue);
}
.app-howto-toggle:hover { opacity: .8; }
.app-howto-arrow { font-size: 8px; transition: transform .2s; display: inline-block; }
.app-howto-arrow.open { transform: rotate(90deg); }

.app-howto-panel {
  margin: 10px auto 0; max-width: 640px; text-align: left;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px;
}
.app-howto-steps {
  list-style: none; counter-reset: howto; display: flex; flex-direction: column; gap: 9px;
}
.app-howto-steps li {
  font-size: 11px; color: var(--text); line-height: 1.6; padding-left: 22px; position: relative;
  counter-increment: howto;
}
.app-howto-steps li::before {
  content: counter(howto); position: absolute; left: 0; top: 0;
  width: 16px; height: 16px; border-radius: 50%; background: var(--text); color: #fff;
  font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.app-howto-steps strong { font-weight: 800; }

/* ══════════════════════════════════════════
   COL 1 — nav + ferias + base de datos
══════════════════════════════════════════ */
.col1-nav {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px;
}

.nav-btn {
  display: block; width: 100%; background: none;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 16px; text-align: left;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px; font-weight: 700; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.nav-btn:hover  { border-color: var(--text); color: var(--text); background: #fff; }
.nav-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.column-title {
  font-size: 16px; font-weight: 800; color: var(--text);
  text-transform: none; letter-spacing: normal; margin-bottom: 10px; text-align: left;
}

.col1-section {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; margin-bottom: 16px;
}

.data-action-btn {
  display: block; width: 100%; background: none;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; margin-bottom: 4px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 10px; font-weight: 700; color: var(--muted);
  cursor: pointer; text-align: left; transition: all .12s;
}
.data-action-btn:hover { border-color: var(--text); color: var(--text); background: #fff; }

.col1-credit {
  position: fixed; bottom: 20px; right: 20px;
  font-size: 11px; color: var(--muted); line-height: 1.5; z-index: 50;
}
.col1-credit a { font-weight: 700; color: var(--blue); text-decoration: none; }

/* ══════════════════════════════════════════
   FERIAS LIST
══════════════════════════════════════════ */
.feria-item {
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 3px; transition: all .12s;
}
.feria-item:hover  { background: #fff; border-color: var(--border); }
.feria-item.active { background: #fff; border-color: var(--blue); }
.feria-item-name   { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feria-item-meta   { font-size: 10px; font-weight: 700; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.feria-item-status { display: flex; gap: 3px; margin-top: 5px; }
.status-dot        { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.status-dot.done   { background: var(--green); }
.status-dot.partial{ background: var(--orange); }

/* ══════════════════════════════════════════
   DETAIL EMPTY
══════════════════════════════════════════ */
.detail-empty       { display: flex; align-items: center; justify-content: center; min-height: 280px; }
.detail-empty-inner { text-align: center; color: var(--muted); }
.empty-icon         { font-size: 28px; opacity: .2; margin-bottom: 12px; display: block; }

/* ══════════════════════════════════════════
   FERIA HEADER
══════════════════════════════════════════ */
.feria-header-block {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 20px; margin-bottom: 20px; text-align: center;
}

.feria-title-input {
  border: none; background: transparent; font-size: 18px; font-weight: 800;
  width: 100%; outline: none; color: var(--text); font-family: Helvetica, Arial, sans-serif;
  text-align: center;
  border-bottom: 2px solid transparent; padding-bottom: 2px; transition: border-color .15s;
}
.feria-title-input:focus        { border-bottom-color: var(--blue); }
.feria-title-input::placeholder { color: var(--border); font-weight: 400; }

.feria-meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; }

.meta-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px;
}
.meta-chip-label { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.meta-chip input {
  border: none; background: transparent; font-family: Helvetica, Arial, sans-serif;
  font-size: 12px; font-weight: 700; color: var(--text); outline: none; width: 72px; text-align: right;
}

/* ══════════════════════════════════════════
   KPI STRIP
══════════════════════════════════════════ */
.kpi-strip {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1px; background: var(--border);
  border-top: 1px solid var(--border); overflow: hidden; margin-top: 16px;
}
.kpi-item   { background: #fff; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.kpi-value  { font-size: 15px; font-weight: 800; line-height: 1; color: var(--text); }
.kpi-value.blue   { color: var(--blue); }
.kpi-value.orange { color: var(--orange); }
.kpi-value.red    { color: var(--red); }
.kpi-label  { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.alerta {
  background: #fef3c7; border: 1px solid var(--orange); border-radius: 8px;
  padding: 8px 12px; font-size: 11px; font-weight: 700; color: #92400e;
  margin-top: 14px; line-height: 1.5;
}

/* ══════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════ */
.section-block  {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin-bottom: 20px;
}
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.section-header > div:first-child { display: flex; align-items: center; gap: 10px; }
.section-title-text { font-size: 18px; font-weight: 800; }
.section-desc   { font-size: 11px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }

.blocked-state  { text-align: center; padding: 20px 16px; background: var(--bg); border: 1px dashed var(--border); border-radius: 14px; margin-bottom: 10px; }
.blocked-icon   { font-size: 22px; margin-bottom: 6px; }
.blocked-state p { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }

/* ══════════════════════════════════════════
   STOCK TABLE — 6 columnas
══════════════════════════════════════════ */
.stock-col-headers {
  display: grid;
  grid-template-columns: 1fr 100px 64px 64px 68px 22px;
  gap: 5px; padding: 0 0 5px; border-bottom: 1px solid var(--border); margin-bottom: 3px;
}
.stock-col-headers span { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.th-r { text-align: right; }

.stock-row {
  display: grid;
  grid-template-columns: 1fr 100px 64px 64px 68px 22px;
  gap: 5px; align-items: center; margin-bottom: 3px;
}

#stock-tbody {
  max-height: 420px; overflow-y: auto;
}

/* Desplegable para añadir título — lista completa del catálogo con "+ Nuevo título" siempre primero */
.stock-add-dropdown {
  position: relative;
  margin-top: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  overflow: hidden;
}
.stock-add-list {
  max-height: 280px; overflow-y: auto;
}
.stock-add-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; cursor: pointer; font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--bg); transition: background .1s;
}
.stock-add-item:last-child { border-bottom: none; }
.stock-add-item:hover { background: var(--bg); }
.stock-add-item-meta { font-size: 10px; color: var(--muted); font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* Fila especial "+ Nuevo título" — siempre primera, visualmente distinta */
.stock-add-item.is-new {
  color: var(--blue); font-weight: 800; background: rgba(0,0,255,0.06);
}
.stock-add-item.is-new:hover { background: rgba(0,0,255,0.12); }

.stock-add-empty {
  padding: 14px 12px; font-size: 11px; color: var(--muted); text-align: center; font-style: italic;
}

/* Fila de creación de título nuevo — nombre + precio + peso + confirmar, todo editable inline */
.stock-add-new-row {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg);
}
.stock-add-new-row input#stock-add-input {
  border: 1px solid var(--blue); background: #fff; border-radius: 4px;
  font-family: Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 600;
  color: var(--text); padding: 7px 8px; outline: none;
  flex: 1 1 auto; min-width: 60px;
}
.stock-add-extra-field {
  display: flex; align-items: center; gap: 3px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 0 6px;
}
.stock-add-extra-field input {
  border: none; background: transparent; outline: none; text-align: right;
  font-family: Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 700;
  color: var(--text); width: 56px; padding: 7px 0; -moz-appearance: textfield;
}
.stock-add-extra-field input::-webkit-outer-spin-button,
.stock-add-extra-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stock-add-extra-unit { font-size: 8px; font-weight: 800; color: var(--muted); text-transform: uppercase; white-space: nowrap; }

.stock-add-confirm-btn {
  background: var(--text); color: #fff; border: none; border-radius: 6px;
  font-family: Helvetica, Arial, sans-serif; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .3px; cursor: pointer;
  padding: 8px 12px; flex-shrink: 0; transition: opacity .15s;
}
.stock-add-confirm-btn:hover { opacity: .85; }

.section-header-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Celdas */
.cell-name {
  display: flex; align-items: center; background: #fff;
  border: 1px solid var(--border); border-radius: 4px; padding: 0 8px; min-width: 0;
}
.cell-name span {
  font-size: 12px; font-weight: 600; padding: 7px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; width: 100%;
}

/* Spinner +/− */
.cell-num-wrap {
  display: flex; align-items: stretch; background: #fff;
  border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
}
.spin-btn {
  background: var(--bg); border: none; font-family: Helvetica, Arial, sans-serif;
  font-size: 15px; font-weight: 700; color: var(--muted);
  cursor: pointer; padding: 0 7px; min-height: 30px;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s, color .1s; flex-shrink: 0; user-select: none; line-height: 1;
}
.spin-btn:first-child { border-right: 1px solid var(--border); }
.spin-btn:last-child  { border-left: 1px solid var(--border); }
.spin-btn:hover  { background: var(--text); color: #fff; }
.spin-btn:active { background: var(--blue); color: #fff; }

.spin-input {
  border: none; background: transparent; outline: none;
  font-family: Helvetica, Arial, sans-serif; font-size: 13px; font-weight: 800;
  color: var(--text); text-align: center; width: 100%; padding: 5px 2px;
  -moz-appearance: textfield;
}
.spin-input::-webkit-outer-spin-button,
.spin-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Teclado: flechas arriba/abajo sobre spin-input */
.spin-input:focus { outline: none; background: rgba(0,0,255,0.05); }

.cell-unit { font-size: 8px; font-weight: 800; color: var(--muted); text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }

.cell-readonly { text-align: right; font-size: 12px; font-weight: 700; color: var(--text); padding: 7px 2px; white-space: nowrap; }
.cell-readonly.muted { color: var(--muted); font-weight: 600; }

/* Celda "sin repartir" — solo cifra o icono, sin texto */
.cell-sinrep {
  text-align: center; font-size: 12px; font-weight: 800; padding: 7px 4px; white-space: nowrap;
  min-width: 0;
}
.cell-sinrep.ok   { color: var(--green); font-size: 14px; }
.cell-sinrep.warn { color: var(--orange); }
.cell-sinrep.bad  { color: var(--red); }

.row-remove {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 4px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; transition: color .1s;
}
.row-remove:hover { color: var(--red); }

/* ══════════════════════════════════════════
   BOTONES / ADD
══════════════════════════════════════════ */
.add-btn {
  width: 100%; background: none; border: 1px dashed var(--border);
  padding: 8px; border-radius: 6px; color: var(--muted); cursor: pointer;
  font-size: 11px; font-weight: 700; font-family: Helvetica, Arial, sans-serif;
  transition: all .15s; margin-top: 6px;
}
.add-btn:hover { border-color: var(--text); color: var(--text); }

.btn { padding: 12px 18px; border-radius: 999px; font-family: Helvetica, Arial, sans-serif; font-weight: 800; font-size: 11px; cursor: pointer; border: none; letter-spacing: .3px; transition: background-color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { opacity: .85; }
.btn-sm { padding: 10px 16px; font-size: 10px; }
.btn-dark         { background: var(--blue); color: #fff; }
.btn-dark:hover   { background: var(--blue-hover); opacity: 1; }
.btn-outline      { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text); opacity: 1; }
.btn-danger-ghost { background: #fff; border: 1px solid var(--red); color: var(--red); }
.btn-danger-ghost:hover { background: rgba(214, 31, 31, 0.06); opacity: 1; }
.btn-green        { background: var(--blue); color: #fff; }
.btn-green:hover  { background: var(--blue-hover); opacity: 1; }
.btn:disabled, .btn-green:disabled {
  background: var(--border); color: var(--muted); cursor: not-allowed; opacity: 1;
}
.btn:disabled:hover { opacity: 1; }

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

/* ══════════════════════════════════════════
   PAQUETES
══════════════════════════════════════════ */
.contenedor-block {
  border: 1px solid var(--border); border-radius: 14px;
  margin-bottom: 8px; overflow: hidden;
}

/* Cabecera clickable */
.co-head {
  display: flex; align-items: stretch; background: #f0f0f0; color: var(--text);
  cursor: pointer; user-select: none; transition: background .12s; min-height: 42px;
}
.co-head:hover { background: #e4e4e4; }

.co-toggle-zone {
  display: flex; align-items: center; padding: 0 12px; gap: 9px; flex: 1; min-width: 0;
}
.co-toggle-arrow { font-size: 11px; opacity: .65; flex-shrink: 0; transition: transform .2s; }
.co-toggle-arrow.open { transform: rotate(90deg); }

.co-head-name { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }

.co-head-stats {
  display: flex; flex-shrink: 0; border-left: 1px solid rgba(0,0,0,.12);
}
.co-head-stat {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-end;
  padding: 9px 13px; border-right: 1px solid rgba(0,0,0,.12);
}
.co-head-stat:last-child { border-right: none; }
.co-head-stat-val   { font-size: 12px; font-weight: 800; line-height: 1; }
.co-head-stat-label { font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; opacity: .75; }

/* Badge de estado en cabecera */
.co-status-badge {
  font-size: 11px; font-weight: 800; padding: 0 10px;
  display: flex; align-items: center; white-space: nowrap;
  border-left: 1px solid rgba(0,0,0,.12);
}
.co-status-badge.ok   { color: var(--green); }
.co-status-badge.over { color: var(--red); }
.co-status-badge.warn { color: var(--orange); }

/* X eliminar en cabecera */
.co-head-remove {
  background: none; border: none; color: rgba(0,0,0,.45);
  cursor: pointer; padding: 0 13px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; border-left: 1px solid rgba(0,0,0,.12);
  transition: color .1s, background .1s; flex-shrink: 0;
}
.co-head-remove:hover { color: #fff; background: var(--red); }

/* Body */
.co-body { display: none; }
.co-body.open { display: block; background: #fff; }

/* Config */
.co-config {
  padding: 10px 14px; background: #fff;
  border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
}

.tipo-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tipo-label-txt { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }

.tipo-btn {
  background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px;
  font-family: Helvetica, Arial, sans-serif; font-size: 10px; font-weight: 700; color: var(--muted);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.tipo-btn:hover { border-color: var(--text); color: var(--text); }
.tipo-btn.sel-postal { background: var(--blue); border-color: var(--blue); color: #fff; }
.tipo-btn.sel-avion  { background: var(--text); border-color: var(--text); color: #fff; }

.tipo-hint {
  font-size: 10px; color: var(--muted); line-height: 1.5;
  padding: 2px 0;
}

/* Peso vacío + límite — misma línea, estilo meta-chip */
.co-peso-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.co-peso-inline .meta-chip input { width: 52px; }

/* Barra de peso */
.co-peso-bar-wrap { padding: 8px 14px 10px; border-bottom: 1px solid var(--border); }
.co-bar-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.co-bar-label  { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.co-bar-value  { font-size: 11px; font-weight: 800; }
.bar-track     { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bar-fill      { height: 100%; border-radius: 3px; transition: width .3s, background .3s; }
.co-bar-labels { display: flex; justify-content: space-between; font-size: 9px; font-weight: 700; color: var(--muted); margin-top: 3px; }

/* Reparto */
.co-reparto { padding: 10px 14px; }

.reparto-col-headers {
  display: grid; grid-template-columns: 1fr 110px 80px;
  gap: 6px; margin-bottom: 5px;
}
.reparto-col-headers span { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.reparto-col-headers span:not(:first-child) { text-align: right; }

.reparto-row {
  display: grid; grid-template-columns: 1fr 110px 80px;
  gap: 6px; align-items: center; margin-bottom: 4px;
}

.reparto-rows {
  max-height: 238px; overflow-y: auto;
}
.reparto-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }

.reparto-progress { font-size: 10px; font-weight: 800; text-align: right; padding: 2px; font-variant-numeric: tabular-nums; }
.reparto-progress.ok   { color: var(--green); }
.reparto-progress.warn { color: var(--orange); }
.reparto-progress.over { color: var(--red); }
.reparto-progress.none { color: var(--muted); }

/* ══════════════════════════════════════════
   CHECKLIST
══════════════════════════════════════════ */
.checklist-card { margin-top: 14px; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.checklist-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.checklist-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 14px; border-bottom: 1px solid var(--bg); font-size: 11px; }
.checklist-row:last-child { border-bottom: none; }
.checklist-icon  { font-size: 12px; flex-shrink: 0; width: 16px; text-align: center; margin-top: 1px; }
.checklist-label { font-weight: 600; flex: 1; }
.checklist-detail { font-size: 10px; color: var(--muted); font-weight: 600; text-align: right; white-space: nowrap; margin-left: 8px; }
.checklist-row.ok   .checklist-icon { color: var(--green); }
.checklist-row.ok   .checklist-label { color: var(--green); }
.checklist-row.warn .checklist-icon { color: var(--orange); }
.checklist-row.warn .checklist-label { color: var(--orange); }
.checklist-row.bad  .checklist-icon { color: var(--red); }
.checklist-row.bad  .checklist-label { color: var(--red); }
.checklist-row.idle { opacity: .65; }
.checklist-row.idle .checklist-icon { color: var(--muted); }
.checklist-row.idle .checklist-label { color: var(--muted); font-weight: 500; }

/* ══════════════════════════════════════════
   CATÁLOGO
══════════════════════════════════════════ */
.catalogo-table-container { max-width: 520px; }

.cat-col-headers {
  display: grid; grid-template-columns: 1fr 120px 100px 24px;
  gap: 6px; padding: 0 0 5px; border-bottom: 1px solid var(--border); margin-bottom: 3px;
}
.cat-col-headers span { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.cat-row { display: grid; grid-template-columns: 1fr 120px 100px 24px; gap: 6px; align-items: center; margin-bottom: 3px; }

.cell-num {
  display: flex; align-items: center; justify-content: flex-end;
  background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; gap: 3px;
}
.cell-num input {
  border: none; background: transparent; outline: none;
  font-family: Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 700;
  color: var(--text); text-align: right; width: 100%; padding: 7px 0;
}

.catalogo-tip { margin-top: 20px; max-width: 520px; padding: 11px 13px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 11px; color: var(--muted); line-height: 1.6; }

/* ══════════════════════════════════════════
   HINTS
══════════════════════════════════════════ */
.hint-text   { font-size: 11px; color: var(--muted); line-height: 1.6; }
.hint-italic { font-style: italic; }

/* ══════════════════════════════════════════
   MODALES
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 460px;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal--wide { max-width: 680px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 12px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-title  { font-size: 18px; font-weight: 800; }
.modal-header-actions { display: flex; gap: 6px; align-items: center; }
.modal-close  { background: none; border: none; font-size: 13px; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; transition: color .1s; }
.modal-close:hover { color: var(--text); }
.modal-body   { padding: 14px 18px 18px; overflow-y: auto; flex: 1; }
.modal-body--packing { padding: 0; }

/* ══════════════════════════════════════════
   PACKING LIST (pantalla — info completa)
══════════════════════════════════════════ */
.packing-contenedores { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px; }
.packing-box { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.packing-box-header {
  padding: 8px 14px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px; background: var(--text); color: #fff;
}
.packing-box-header.postal      { background: var(--blue); }
.packing-box-header.avion       { background: var(--text); }
.packing-box-header.sin-asignar { background: var(--orange); }
.packing-box-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.packing-box-meta  { display: flex; gap: 12px; font-size: 10px; font-weight: 700; opacity: .8; }

.packing-box-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.packing-box-table th { text-align: left; padding: 6px 14px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--border); }
.packing-box-table th.th-r { text-align: right; }
.packing-box-table td { padding: 6px 14px; border-bottom: 1px solid var(--bg); font-weight: 600; }
.packing-box-table tbody tr:last-child td { border-bottom: none; }
.packing-box-table td.td-r { text-align: right; font-weight: 700; }
.packing-box-table tfoot td { background: var(--bg); font-weight: 700; font-size: 11px; padding: 5px 14px; }
.packing-box-table tfoot tr:last-child td { background: var(--border); font-weight: 800; }

/* ══════════════════════════════════════════
   PRINT — packing list compacto con checkboxes
══════════════════════════════════════════ */

/* Checkbox de impresión (visible solo en print) */
.print-checkbox {
  display: none;   /* oculto en pantalla */
  width: 11px; height: 11px;
  border: 1.5px solid #555; border-radius: 2px;
  flex-shrink: 0; margin-right: 4px;
}

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { padding: 10px 16px; background: #fff; font-size: 8.5px; }

  .container { display: none !important; }

  .modal-overlay { position: static; background: none; padding: 0; display: block; }
  .modal {
    box-shadow: none; border-radius: 0; max-width: 480px;
    max-height: none; border: none; margin: 0 auto;
  }
  .modal-header { padding: 0 0 6px; border-bottom: 2px solid #000; margin-bottom: 8px; }
  .modal-header-actions, .modal-close { display: none !important; }
  .modal-title  { font-size: 13px; font-weight: 800; }
  .modal-body   { overflow: visible; padding: 0; }

  .packing-contenedores { padding: 0; gap: 8px; }
  .packing-box { break-inside: avoid; border: 1px solid #999; border-radius: 3px; margin-bottom: 6px; }

  .packing-box-header { padding: 4px 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .packing-box-title  { font-size: 8.5px; font-weight: 800; }
  .packing-box-meta   { font-size: 7px; gap: 8px; }

  .packing-box-table         { font-size: 8.5px; }
  .packing-box-table th      { padding: 3px 8px; font-size: 7px; }
  .packing-box-table td      { padding: 3px 8px; }
  .packing-box-table tfoot td{ padding: 3px 8px; font-size: 7.5px; }

  /* Mostrar checkboxes en print */
  .print-checkbox { display: inline-block; }

  /* Ocultar columna peso/ud en print */
  .print-hide { display: none !important; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1080px) { .three-col { grid-template-columns: 210px 1fr 1fr; } }
@media (max-width: 820px)  {
  .three-col { grid-template-columns: 1fr; }
  .col-ferias  { border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 14px; position: static; }
  .col-stock   { border-right: none; padding: 14px 0; }
  .col-reparto { padding: 0; }
  .kpi-strip   { grid-template-columns: 1fr 1fr; }
  .stock-col-headers, .stock-row { grid-template-columns: 1fr 90px 70px 70px 70px 22px; }
}

/* ══════════════════════════════════════════
   PACKING LIST — checkbox column
══════════════════════════════════════════ */
.print-checkbox-col {
  width: 20px; padding-left: 8px !important; padding-right: 4px !important;
}

@media print {
  .print-checkbox-col { width: 16px; padding-left: 6px !important; padding-right: 2px !important; }
}

/* ══════════════════════════════════════════
   PACKING LIST — documento imprimible
══════════════════════════════════════════ */
.pl-doc { padding: 16px 20px; }

.pl-header {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--text);
  margin-bottom: 14px;
}
.pl-header-title { font-size: 18px; font-weight: 800; }
.pl-header-meta  {
  display: flex; gap: 8px; align-items: center;
  font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px;
}

.pl-paquetes { display: flex; flex-direction: column; gap: 12px; }

.pl-paquete {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}

.pl-paquete-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 12px;
  background: var(--text); color: #fff;
}
.pl-paquete-nombre { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.pl-paquete-tipo   { font-size: 10px; font-weight: 600; opacity: .6; flex: 1; }
.pl-paquete-peso   { font-size: 11px; font-weight: 800; }

.pl-sin-asignar .pl-paquete-head { background: var(--orange); }

.pl-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.pl-table th {
  text-align: left; padding: 5px 12px;
  font-size: 9px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.pl-table td { padding: 5px 12px; border-bottom: 1px solid var(--bg); }
.pl-table tbody tr:last-child td { border-bottom: none; }
.pl-num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-cb  { width: 18px; padding-right: 4px !important; }

.pl-subtotal td { background: var(--bg); font-size: 11px; font-weight: 700; padding: 4px 12px; }
.pl-total    td { background: var(--border); font-size: 11px; font-weight: 700; padding: 4px 12px; }

/* ══════════════════════════════════════════
   PRINT — packing list como documento
══════════════════════════════════════════ */
@media print {
  .pl-doc { padding: 0; }

  .modal--wide { max-width: 460px; margin: 0 auto; }

  .pl-header { padding-bottom: 6px; margin-bottom: 8px; }
  .pl-header-title { font-size: 13px; }
  .pl-header-meta  { font-size: 8px; gap: 5px; }

  .pl-paquetes { gap: 7px; }
  .pl-paquete  { break-inside: avoid; border: 1px solid #aaa; border-radius: 3px; }

  .pl-paquete-head   { padding: 4px 8px; }
  .pl-paquete-nombre { font-size: 9px; }
  .pl-paquete-tipo   { font-size: 8px; }
  .pl-paquete-peso   { font-size: 9px; }

  .pl-table th { padding: 3px 8px; font-size: 7px; }
  .pl-table td { padding: 3px 8px; font-size: 8.5px; }
  .pl-subtotal td, .pl-total td { padding: 2px 8px; font-size: 8px; }

  .pl-cb { width: 14px; }
  .print-checkbox { display: inline-block; }
}
