/* =========================
   vendedor.css
   ========================= */

/* Paleta y utilidades base (compat con Tailwind) */
:root{
  --vs:#dc2626;     /* rojo Sion */
  --vsd:#b91c1c;    /* rojo oscuro */
  --soft-bg:#111827;
  --soft-bd:#374151;
  --muted:#9ca3af;
}

.bg-vs{background:var(--vs)!important}
.bg-vsd{background:var(--vsd)!important}
.text-vs{color:var(--vs)!important}

.soft{
  background:var(--soft-bg);
  border:1px solid var(--soft-bd);
}

.muted{ color: var(--muted); }

.chip{
  padding:.25rem .6rem;
  border-radius:999px;
  font-size:.75rem;
  background:#2563eb;
  color:#fff;
}

.pill{
  background:#0b1220;
  border:1px solid #334155;
  border-radius:999px;
  padding:.25rem .6rem;
  font-size:.75rem;
  color:#cbd5e1;
  transition:all .15s ease-in-out;
}
.pill:hover{ border-color:#60a5fa; color:#e5e7eb }

/* Dialog backdrop */
dialog::backdrop{ background:rgba(0,0,0,.55) }

/* Drag&Drop */
.drop{
  border:1px dashed #475569;
  border-radius:.75rem;
  transition:all .15s ease-in-out;
}
.drop.drag{
  background:#0b2440;
  border-color:#60a5fa;
}

/* =========================
   RECIBO (Comprobante de Seña)
   ========================= */

.recibo{
  max-width: 800px;
  padding: 8px 4px 24px;
  color:#0f172a;
  font-size:14px;
}

.recibo-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.recibo-title{
  text-align:center;
  font-size:12px;
  color:#334155;
  margin-bottom:8px;
}

.recibo-empresa-nombre{
  font-weight:700;
  font-size:20px;
}
.recibo-empresa-det{
  font-size:11px;
  color:#475569;
  line-height:1.2;
}

.recibo-logo{
  width:120px;
  height:64px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.recibo-logo img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

.recibo-meta{
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:center;
  gap:6px 12px;
  margin:8px 0 10px;
}
.recibo-doc{
  grid-column:1/2;
  text-align:right;
  color:#334155;
}
.recibo-nro{
  grid-column:2/3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.recibo-orig{
  grid-column:2/3;
  justify-self:end;
  margin-top:-6px;
  font-size:11px;
  color:#64748b;
}

/* Tarjetas/boxes */
.recibo-card{
  border:1px solid #e2e8f0;
  border-radius:8px;
  padding:12px;
  margin:12px 0;
  background:#fff;
}

.recibo-row{
  display:block;
  line-height:1.35;
}
.recibo-row-flex{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.recibo-sub{
  font-size:12px;
  color:#64748b;
  margin-top:4px;
}

/* Tablas con grid adaptable (2 o 4 columnas) */
.recibo-table{
  display:grid;
  grid-template-columns: 1fr 1fr; /* por defecto 2 cols (Formas de pago) */
  gap:6px 12px;
  align-items:center;
  font-size:14px;
}
.recibo-table:has(.col-span-4){
  /* Si existe una celda que abarca 4, asumimos tabla de 4 columnas
     (Numeración / Fecha / Imp. / Canc.) */
  grid-template-columns: 1fr 1fr .7fr .7fr;
}

.recibo-th{
  font-weight:600;
  border-bottom:1px solid #e2e8f0;
  padding-bottom:6px;
}
.recibo-td{
  padding:6px 0;
}
.recibo-td.border-t{ border-top:1px solid #e2e8f0 }
.recibo-td.text-right{ text-align:right }
.recibo-td.text-center{ text-align:center }

/* Firmas / pie */
.recibo-firmas{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
  align-items:end;
  margin-top:10px;
}
.recibo-box{
  border:1px solid #e2e8f0;
  border-radius:8px;
  padding:10px 12px;
}
.recibo-linea{
  margin:8px 0 6px;
  height:1px;
  background:#cbd5e1;
}
.recibo-fecha{
  text-align:right;
  color:#475569;
  font-size:13px;
}

.recibo-foot{
  margin-top:12px;
  font-size:11px;
  color:#64748b;
}

/* =========================
   PRINT
   ========================= */

@page{
  size: A4;
  margin: 14mm;
}

@media print{
  :root{ color-scheme: light; }

  body{
    background:#fff !important;
    color:#000 !important;
    margin:0;
  }

  /* Ocultar la pantalla normal */
  header,
  main,
  #toast{
    display:none !important;
  }

  /* Mostrar solo el diálogo del comprobante */
  #dlgRecibo{
    display:block !important;
    position:static !important;
    inset:auto !important;
    margin:0;
    padding:0;
    border:0;
  }

  /* El contenedor "soft" pasa a ser solo fondo blanco sin sombras */
  #dlgRecibo .soft{
    background:#fff !important;
    border:0 !important;
    box-shadow:none !important;
    padding:0 !important;
  }

  /* Ocultar barra superior (título Nota de venta + botón Imprimir)
     y barra inferior (Cerrar / Guardar comprobante) */
  #dlgRecibo .soft > div:first-child,
  #dlgRecibo .soft > div:last-child{
    display:none !important;
  }

  /* Zona imprimible: solo la nota */
  #reciboArea{
    padding:0 !important;
    background:#fff !important;
    color:#000 !important;
  }

  .recibo{
    max-width:unset;
  }
}

/* Accesibilidad: foco visible para pills */
.pill:focus{
  outline:2px solid #60a5fa;
  outline-offset:2px;
}

/* Estados deshabilitados consistentes */
button[disabled]{
  opacity:.45;
  cursor:not-allowed;
}

/* Autocomplete Google Maps en tema oscuro, encima del modal */
.pac-container{
  z-index: 999999 !important;
  background-color: #020617 !important; /* casi negro */
  border: 1px solid #374151 !important;
  color: #e5e7eb !important;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.75);
}

.pac-item{
  padding: 6px 10px;
  cursor: pointer;
}

.pac-item:hover{
  background-color: #111827 !important;
}

.pac-item span,
.pac-item .pac-item-query{
  color: #e5e7eb !important;
}

/* Contenedor del mapa en el modal */
#cl-obra-map-wrapper{
  background-color: #020617;
}

#cl-obra-map{
  width: 100%;
  height: 100%;
}



/* Botones rojos Sion (evita inline styles) */
.btn-vs{
  background:var(--vs) !important;
  transition:0.2s;
}
.btn-vs:hover{
  background:var(--vsd) !important;
}
