* { box-sizing: border-box; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f5f7;
  color: #1b2a33;
  margin: 0;
  padding: 0;
}
header {
  background: #0b4f6c;
  color: white;
  padding: 16px 24px;
}
header h1 { margin: 0; font-size: 20px; }
header .subtitulo { margin: 4px 0 0; font-size: 13px; opacity: 0.85; }
.version-app { margin: 10px 0 0; font-size: 12px; min-height: 1em; }
.version-app .badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-weight: 600; }
.version-app .badge.aldia { background: rgba(255, 255, 255, 0.18); color: #eafaef; }
.version-app .badge.actualizar { background: #ffd24a; color: #3b2f00; text-decoration: none; }
.version-app .badge.actualizar:hover { background: #ffc31f; }

main { max-width: 900px; margin: 0 auto; padding: 24px; }

.bloque {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}
.bloque h2 {
  margin-top: 0;
  font-size: 17px;
  color: #0b4f6c;
  border-bottom: 1px solid #dde5e9;
  padding-bottom: 8px;
}

.fila { display: flex; flex-direction: column; margin-bottom: 14px; }
.fila label { font-size: 13px; font-weight: bold; margin-bottom: 4px; color: #3a4a52; }
.fila-inline { display: flex; gap: 8px; align-items: center; }

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

input[type="text"], input[type="number"], select {
  padding: 8px;
  border: 1px solid #c3d0d6;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
}

.destacado {
  background: #eef6f9;
  border: 1px solid #c3d0d6;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 16px;
}
.destacado label { font-weight: bold; display: block; margin-bottom: 6px; }

.ayuda { color: #7a8891; font-size: 12px; margin: 6px 0 0; }
.ayuda.error { color: #b3261e; font-weight: bold; }
.fila-dxf { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.campo-invalido { border-color: #b3261e !important; background: #fdecea; }
input[readonly].campo-bloqueado { background: #eef1f3; color: #5a6b73; cursor: not-allowed; }
.estado { font-size: 13px; margin: 8px 0 0; min-height: 1.2em; }
.estado.ok { color: #2e8b41; font-weight: bold; }
.estado.error { color: #b3261e; font-weight: bold; }

.busqueda-alt { margin-bottom: 16px; }
.busqueda-alt summary {
  cursor: pointer;
  color: #0b4f6c;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 10px;
}

.lista-candidatos {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 260px;
  overflow-y: auto;
}
.candidato-item {
  padding: 10px 12px;
  border: 1px solid #dde5e9;
  border-radius: 6px;
  cursor: pointer;
  background: #fafcfd;
}
.candidato-item:hover { background: #eef6f9; border-color: #0b4f6c; }
.candidato-item label { cursor: pointer; font-weight: normal; }

.resumen-presupuesto {
  background: #eef6f9;
  border: 1px solid #c3d0d6;
  border-radius: 6px;
  padding: 12px 16px;
}
.resumen-presupuesto p { margin: 4px 0; }
.resumen-presupuesto strong { color: #0b4f6c; }

.oculto { display: none !important; }

/* Lupa "Buscar cliente" (base de datos NORPOL CLIENTES) junto a Promotor */
.btn-lupa {
  font-size: 13px;
  padding: 4px 10px;
  margin-left: 10px;
  vertical-align: middle;
}
.buscador-clientes {
  background: #eef6f9;
  border: 1px solid #c3d0d6;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 16px;
}
#resultados-clientes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
}
.cliente-item {
  padding: 10px 12px;
  border: 1px solid #dde5e9;
  border-radius: 6px;
  cursor: pointer;
  background: #fafcfd;
}
.cliente-item:hover { background: #e3f1f7; border-color: #0b4f6c; }
.cliente-item .cliente-datos { color: #7a8891; font-size: 12px; margin-top: 2px; }
.cliente-item .etiqueta {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 6px;
  background: #d7ecd9;
  color: #2e8b41;
}

.acciones { margin-top: 8px; }

button {
  background: #0b4f6c;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
button:hover { background: #093c53; }
button:disabled { background: #9db3bc; cursor: not-allowed; }

a { color: #0b4f6c; }
