/* Complementos a Tailwind: componentes repetidos y estados que cambia app.js.
   Los colores salen de la paleta definida en tailwind.config (index.html). */

/* ── Escala automática (variable --escala, calculada en index.html) ──
   zoom reduce toda la interfaz; el alto se compensa para seguir ocupando
   exactamente la pantalla. */
@media (min-width: 1024px) {
  body { zoom: var(--escala, 1); height: calc(100vh / var(--escala, 1)); }
}

.material-symbols-outlined { font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20; line-height: 1; }

/* ── Header ── */
.hdr-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 0.25rem; font-size: 13px; font-weight: 600;
  background: #f3f3f5; color: #48464c; transition: background .15s, color .15s;
}
.hdr-btn:hover { background: #e5e5e9; color: #1d1b1e; }
.hdr-btn-warn { background: #fff1c7; color: #5a4100; }
.hdr-btn-warn:hover { background: #ffe597; color: #3d2c00; }

/* ── Tarjetas de viaje (panel izquierdo) ── */
.viaje-item {
  position: relative; padding: 8px 10px 8px 14px; border-radius: 0.25rem;
  background: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: background .15s, box-shadow .15s;
}
.viaje-item:hover { background: #fafafa; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.viaje-item.activo { box-shadow: 0 2px 8px rgba(204,0,0,.15); }
.viaje-item.activo::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: #cc0000; border-radius: 0.25rem 0 0 0.25rem;
}
.viaje-item.activo .viaje-nombre { color: #cc0000; }

/* ── Pestañas ── */
.tab {
  position: relative; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 14px; border-radius: 0.25rem 0.25rem 0 0;
  background: #f3f3f5; color: #48464c; font-size: 13px; transition: background .15s;
}
.tab:hover { background: #ececef; }
.tab .tab-titulo { font-weight: 600; color: #1d1b1e; }
.tab .tab-sub { font-family: "JetBrains Mono", monospace; font-size: 11px; color: #5f5e66; }
.tab.activa { background: #dadade; color: #cc0000; }
.tab.activa .tab-titulo { color: #cc0000; font-weight: 700; }
.tab.activa::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #cc0000;
}
.tab-chip {
  font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 0.25rem; background: #dadade; color: #5f5e66;
}
.tab.activa .tab-chip { background: #cc0000; color: #fff; }
@media (max-width: 1599px) {
  .tab { padding: 8px 10px; gap: 6px; }
  .tab .tab-sub { display: none; }
}
nav[aria-label="Documentos"] { scrollbar-width: none; }
nav[aria-label="Documentos"]::-webkit-scrollbar { display: none; }
.dot-modelo { display: inline-block; width: 10px; height: 10px; border-radius: 9999px; flex-shrink: 0; }

/* ── Barra de herramientas del visor ── */
.tool-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 6px; border-radius: 0.25rem; color: #5f5e66; transition: background .15s, color .15s;
}
.tool-btn:hover { background: #e5e5e9; color: #1d1b1e; }

/* ── Tabla de pedidos ── */
#tbody-pedidos tr:nth-child(even) { background: rgba(243,243,245,.6); }
#tbody-pedidos tr:hover { background: #ffdad4; }
#tbody-pedidos td { padding: 7px 12px; vertical-align: middle; }
.btn-obs {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px; border-radius: 0.25rem; color: #5f5e66; background: #ececef; transition: background .15s, color .15s;
}
.btn-obs:hover { background: #cc0000; color: #fff; }
.obs-preview {
  display: inline-block; max-width: 200px; vertical-align: middle; margin-left: 6px;
  color: #79767d; font-style: italic; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Panel de control ── */
.campo { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #1d1b1e; }
.campo select, .campo input {
  padding: 6px 8px; border-radius: 0.25rem; background: #f3f3f5; font-size: 13px; font-weight: 400;
  border: 1px solid transparent; outline: none;
}
.campo select:focus, .campo input:focus { border-color: #cc0000; background: #fff; }
.doc-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 0.25rem; background: #f3f3f5;
}
.doc-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 0.25rem; background: #fff; color: #48464c; box-shadow: 0 1px 2px rgba(0,0,0,.08);
  transition: background .15s, color .15s;
}
.doc-btn:hover { background: #cc0000; color: #fff; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(29,27,30,.45);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.visible { display: flex; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000; max-width: 400px;
  display: none; padding: 10px 18px; border-radius: 0.5rem;
  background: #1d1b1e; color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.loading { text-align: center; padding: 30px; color: #79767d; font-size: 13px; }
